1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-03 05:10:03 +02:00

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 ebb0ca3d70)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-05-23 00:23:05 +02:00 committed by Michael Niedermayer
parent 6270401561
commit bd9313d9f8

View File

@ -706,6 +706,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");