Browse Source

motionpixels: Check that the vlc table has been fully inited

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 12 years ago
parent
commit
b5fc95e77f
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/motionpixels.c

+ 4
- 0
libavcodec/motionpixels.c View File

@@ -137,6 +137,10 @@ static int mp_read_codes_table(MotionPixelsContext *mp, GetBitContext *gb)
mp->current_codes_count = 0; mp->current_codes_count = 0;
if ((ret = mp_get_code(mp, gb, 0, 0)) < 0) if ((ret = mp_get_code(mp, gb, 0, 0)) < 0)
return ret; return ret;
if (mp->current_codes_count < mp->codes_count) {
av_log(mp->avctx, AV_LOG_ERROR, "too few codes\n");
return AVERROR_INVALIDDATA;
}
} }
return 0; return 0;
} }


Loading…
Cancel
Save