diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-05-23 00:23:05 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-10 02:13:12 +0200 |
commit | 6cb8599bab1b16331a4fd0423782de67718aa78a (patch) | |
tree | c508800b6237aea14aa2ca6bc85e03f3b877a233 /libavformat | |
parent | 00b8a9dd8d996f8a033aea2598ccc0e44b239b7b (diff) | |
download | ffmpeg-6cb8599bab1b16331a4fd0423782de67718aa78a.tar.gz |
avformat/nutdec: Check X in 2nd branch of index reading
Prevents read of uninitialized variable
Based on patch by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ebb0ca3d70465ab6d369a66b2ef43bb059705db8)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/nutdec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index d3b7ea4d4c..438f898160 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -665,6 +665,10 @@ static int find_and_decode_index(NUTContext *nut) has_keyframe[n++] = flag; has_keyframe[n++] = !flag; } else { + if (x <= 1) { + av_log(s, AV_LOG_ERROR, "index: x %"PRIu64" is invalid\n", x); + goto fail; + } while (x != 1) { if (n >= syncpoint_count + 1) { av_log(s, AV_LOG_ERROR, "index overflow B\n"); |