Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Xiph.Org
flac
Commits
32685de7
Commit
32685de7
authored
Aug 16, 2001
by
Josh Coalson
Browse files
fix bug when skipping data
parent
fa697a98
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/flac/encode.c
View file @
32685de7
...
...
@@ -223,15 +223,13 @@ int flac__encode_wav(FILE *infile, long infilesize, const char *infilename, cons
bps
=
x
;
is_unsigned_samples
=
(
x
==
8
);
bytes_per_wide_sample
=
channels
*
(
bps
>>
3
);
/* skip any extra data in the fmt sub-chunk */
data_bytes
-=
16
;
if
(
data_bytes
>
0
)
{
unsigned
left
,
need
;
for
(
left
=
data_bytes
;
left
>
0
;
)
{
/*@@@ WATCHOUT: 4GB limit */
for
(
left
=
data_bytes
;
left
>
0
;
)
{
need
=
min
(
left
,
CHUNK_OF_SAMPLES
);
if
(
fread
(
ucbuffer
,
1
,
bytes_per_wide_sample
*
need
,
infile
)
<
need
)
{
if
(
fread
(
ucbuffer
,
1
,
need
,
infile
)
<
need
)
{
fprintf
(
stderr
,
"%s: ERROR during read while skipping samples
\n
"
,
encoder_wrapper
.
inbasefilename
);
goto
wav_abort_
;
}
...
...
@@ -269,7 +267,7 @@ int flac__encode_wav(FILE *infile, long infilesize, const char *infilename, cons
unsigned
left
,
need
;
for
(
left
=
(
unsigned
)
skip
;
left
>
0
;
)
{
/*@@@ WATCHOUT: 4GB limit */
need
=
min
(
left
,
CHUNK_OF_SAMPLES
);
if
(
fread
(
ucbuffer
,
1
,
bytes_per_wide_sample
*
need
,
infile
)
<
need
)
{
if
(
fread
(
ucbuffer
,
bytes_per_wide_sample
,
need
,
infile
)
<
need
)
{
fprintf
(
stderr
,
"%s: ERROR during read while skipping samples
\n
"
,
encoder_wrapper
.
inbasefilename
);
goto
wav_abort_
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment