aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/nutdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-23 00:23:05 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-23 00:23:05 +0200
commitebb0ca3d70465ab6d369a66b2ef43bb059705db8 (patch)
tree357a42192b647832afd2efc7dd6b467ab2becbfc /libavformat/nutdec.c
parentf275f9eaee9c69bcbc732002f0ee36f480eebb85 (diff)
downloadffmpeg-ebb0ca3d70465ab6d369a66b2ef43bb059705db8.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>
Diffstat (limited to 'libavformat/nutdec.c')
-rw-r--r--libavformat/nutdec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c
index f1cece8967..ad9053cf73 100644
--- a/libavformat/nutdec.c
+++ b/libavformat/nutdec.c
@@ -720,6 +720,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");