From: Michael Niedermayer Date: Wed, 6 Mar 2013 00:37:49 +0000 (+0100) Subject: mss2dsp/upsample_plane: fix 0x0 handling X-Git-Tag: android-x86-4.4-r1~5356 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7bab631f7df55b361368296f125b95a1814bc18c;p=android-x86%2Fexternal-ffmpeg.git mss2dsp/upsample_plane: fix 0x0 handling Fixes invalid memcpy and out of array accesses Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer --- diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c index b18bf1f0a9..c5fc1f8dcf 100644 --- a/libavcodec/mss2dsp.c +++ b/libavcodec/mss2dsp.c @@ -106,6 +106,9 @@ static void upsample_plane_c(uint8_t *plane, int plane_stride, int w, int h) uint8_t *src1, *src2, *dst1, *dst2, *p, a, b; int i, j; + if(!w || !h) + return; + w += (w & 1); h += (h & 1);