summaryrefslogtreecommitdiff
path: root/libavcodec/motionpixels.c
diff options
context:
space:
mode:
authorLaurent Aimar <fenrir@videolan.org>2011-09-10 13:28:13 +0200
committerJanne Grunau <janne-libav@jannau.net>2011-10-06 22:29:12 +0200
commit69a0bce753a5d5556d5bc0888afe390e22611dd8 (patch)
tree059b35d30f4af4601f18b286858370e750657ff3 /libavcodec/motionpixels.c
parentd97efd7f879779034cca0bd16acceed47718e04e (diff)
Fixed deference of NULL pointer in motionpixels decoder.
Some of the arguments given to init_vlc() come from the stream and can be corrupted. Signed-off-by: Janne Grunau <janne-libav@jannau.net>
Diffstat (limited to 'libavcodec/motionpixels.c')
-rw-r--r--libavcodec/motionpixels.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c
index 21e1bda99c..9589b4c386 100644
--- a/libavcodec/motionpixels.c
+++ b/libavcodec/motionpixels.c
@@ -278,7 +278,8 @@ static int mp_decode_frame(AVCodecContext *avctx,
if (sz == 0)
goto end;
- init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0);
+ if (init_vlc(&mp->vlc, mp->max_codes_bits, mp->codes_count, &mp->codes[0].size, sizeof(HuffCode), 1, &mp->codes[0].code, sizeof(HuffCode), 4, 0))
+ goto end;
mp_decode_frame_helper(mp, &gb);
free_vlc(&mp->vlc);