avformat/mov: check that sample and chunk count is 1 for HEIF

Fixes NULL pointer dereference in broken/fuzzed streams.

Signed-off-by: James Almer <jamrial@gmail.com>
release/7.1
James Almer 9 months ago
parent 39ced529b0
commit 2aa63784b5
  1. 3
      libavformat/mov.c

@ -10063,6 +10063,9 @@ static int mov_read_header(AVFormatContext *s)
st->codecpar->width = item->width;
st->codecpar->height = item->height;
if (sc->sample_count != 1 || sc->chunk_count != 1)
return AVERROR_INVALIDDATA;
sc->sample_sizes[0] = item->extent_length;
sc->chunk_offsets[0] = item->extent_offset + offset;

Loading…
Cancel
Save