From bc0219fd9583da3e73b0363ca0588d7a53d954c0 Mon Sep 17 00:00:00 2001 From: Roberto Togni Date: Fri, 31 Oct 2003 22:28:19 +0000 Subject: [PATCH] Don't memcpy from unallocated memory Originally committed as revision 2459 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/msrle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 8943ef3cdf..f0564a9ca8 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -177,7 +177,8 @@ static int msrle_decode_frame(AVCodecContext *avctx, } /* grossly inefficient, but...oh well */ - memcpy(s->frame.data[0], s->prev_frame.data[0], + if (s->prev_frame.data[0] != NULL) + memcpy(s->frame.data[0], s->prev_frame.data[0], s->frame.linesize[0] * s->avctx->height); msrle_decode_pal8(s);