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>
... | ... |
@@ -706,6 +706,10 @@ static int find_and_decode_index(NUTContext *nut) |
706 | 706 |
has_keyframe[n++] = flag; |
707 | 707 |
has_keyframe[n++] = !flag; |
708 | 708 |
} else { |
709 |
+ if (x <= 1) { |
|
710 |
+ av_log(s, AV_LOG_ERROR, "index: x %"PRIu64" is invalid\n", x); |
|
711 |
+ goto fail; |
|
712 |
+ } |
|
709 | 713 |
while (x != 1) { |
710 | 714 |
if (n >= syncpoint_count + 1) { |
711 | 715 |
av_log(s, AV_LOG_ERROR, "index overflow B\n"); |