Browse Source

avformat/mov: Don't allow negative sample sizes.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 2d8d554f15)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.0.6
Dale Curtis Michael Niedermayer 5 years ago
parent
commit
2b20b1d2ab
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/mov.c

+ 4
- 0
libavformat/mov.c View File

@@ -2863,6 +2863,10 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom)

for (i = 0; i < entries && !pb->eof_reached; i++) {
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];
}



Loading…
Cancel
Save