From 2843502ea424a095b39bce7577de90730fb2a0c6 Mon Sep 17 00:00:00 2001 From: Daniel Kang Date: Mon, 10 Jan 2011 10:47:10 +0000 Subject: Check for invalid decode op-codes, fixes issue 2522. Patch by Daniel Kang, daniel.d.kang at gmail Originally committed as revision 26295 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/interplayvideo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavcodec/interplayvideo.c') diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index b98386f77c..34f055743d 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -99,6 +99,10 @@ static int copy_from(IpvideoContext *s, AVFrame *src, int delta_x, int delta_y) motion_offset, s->upper_motion_limit_offset); return -1; } + if (src->data[0] == NULL) { + av_log(s->avctx, AV_LOG_ERROR, "Invalid decode type, corrupted header?\n"); + return AVERROR(EINVAL); + } s->dsp.put_pixels_tab[!s->is_16bpp][0](s->pixel_ptr, src->data[0] + motion_offset, s->current_frame.linesize[0], 8); return 0; -- cgit v1.2.3