avformat/mov: Error on too large stsd entry counts.
authorDale Curtis <dalecurtis@chromium.org>
Thu, 30 Aug 2018 22:18:25 +0000 (15:18 -0700)
committerMichael Niedermayer <michael@niedermayer.cc>
Sat, 1 Sep 2018 17:26:40 +0000 (19:26 +0200)
commit320b631a99a9f759fd1d5460fd4e285d184b8186
treef611ff72d1b9e86c510788e2b8c8a26b5d036c9f
parenta82e4fb8c6f26e75506df6818fee1b61f940cbeb
avformat/mov: Error on too large stsd entry counts.

Entries are always at least 8 bytes per the parsing code, so if we
see an impossible entry count avoid massive allocations. This is
similar to an existing check in mov_read_stsc().

Since ff_mov_read_stsd_entries() does eof checks, an alternative
approach could be to clamp the entry count to atom.size / 8.

Signed-off-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/mov.c