mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-02-27 09:11:17 +00:00
avformat/mov: Don't allow negative sample sizes.
Signed-off-by: Dale Curtis <dalecurtis@chromium.org> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
ed7d73355e
commit
2d8d554f15
@ -2885,6 +2885,10 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
|
|
||||||
for (i = 0; i < entries && !pb->eof_reached; i++) {
|
for (i = 0; i < entries && !pb->eof_reached; 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) {
|
||||||
|
av_log(c->fc, AV_LOG_ERROR, "Invalid sample size %d\n", sc->sample_sizes[i]);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
sc->data_size += sc->sample_sizes[i];
|
sc->data_size += sc->sample_sizes[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user