From 43c34675afee8ced294ecc436f58587e8e8e913b Mon Sep 17 00:00:00 2001 From: Daniel Kang Date: Mon, 10 Jan 2011 10:28:06 +0000 Subject: [PATCH] Check for invalid motion vector, fixes issue 2521. Patch by Daniel Kang, daniel.d.kang at gmail Originally committed as revision 26293 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/roqvideo.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libavcodec/roqvideo.c b/libavcodec/roqvideo.c index 830eb7b329..eb8fc253ad 100644 --- a/libavcodec/roqvideo.c +++ b/libavcodec/roqvideo.c @@ -115,6 +115,11 @@ static inline void apply_motion_generic(RoqContext *ri, int x, int y, int deltax return; } + if (ri->last_frame->data[0] == NULL) { + av_log(ri->avctx, AV_LOG_ERROR, "Invalid decode type. Invalid header?\n"); + return; + } + for(cp = 0; cp < 3; cp++) { int outstride = ri->current_frame->linesize[cp]; int instride = ri->last_frame ->linesize[cp];