diff options
author | Sean McGovern <gseanmcg@gmail.com> | 2017-07-28 16:17:33 -0400 |
---|---|---|
committer | Sean McGovern <gseanmcg@gmail.com> | 2017-07-30 10:51:12 -0400 |
commit | d7bdab1ad78ef582ba8c96dc7b79ec9fdbeeb94f (patch) | |
tree | e14e38afa864d2c9a13a3d3a1f5762e2e14ec334 /libavformat/mov.c | |
parent | b90fdb2c7199cc8b0e8d994fafba1fb4dc181d88 (diff) |
mov: log and return early on non-positive stsd entry counts
Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mov.c')
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index bf68fbd46a..8ff60222ef 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1875,6 +1875,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); + if (entries <= 0) { + av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries); + return AVERROR_INVALIDDATA; + } + if (sc->extradata) { av_log(c->fc, AV_LOG_ERROR, "Duplicate stsd found in this track.\n"); |