mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-28 20:53:54 +02:00
avformat/mov: Remove pointless EOF checks
9888ffb1ce
added checks for EOF
in loops in the mov demuxer as a precaution against timeouts;
yet there is no I/O in the loop when parsing the STSZ atom
as the values are read from an already read buffer. So remove said
checks.
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
parent
c2d853c1aa
commit
65f9a8e4b8
@ -2884,7 +2884,7 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
init_get_bits(&gb, buf, 8*num_bytes);
|
init_get_bits(&gb, buf, 8*num_bytes);
|
||||||
|
|
||||||
for (i = 0; i < entries && !pb->eof_reached; i++) {
|
for (i = 0; i < entries; i++) {
|
||||||
sc->sample_sizes[i] = get_bits_long(&gb, field_size);
|
sc->sample_sizes[i] = get_bits_long(&gb, field_size);
|
||||||
if (sc->sample_sizes[i] < 0) {
|
if (sc->sample_sizes[i] < 0) {
|
||||||
av_free(buf);
|
av_free(buf);
|
||||||
@ -2898,11 +2898,6 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
av_free(buf);
|
av_free(buf);
|
||||||
|
|
||||||
if (pb->eof_reached) {
|
|
||||||
av_log(c->fc, AV_LOG_WARNING, "reached eof, corrupted STSZ atom\n");
|
|
||||||
return AVERROR_EOF;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user