OSDN Git Service

mss2dsp/upsample_plane: fix 0x0 handling
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Mar 2013 00:37:49 +0000 (01:37 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Mar 2013 00:38:26 +0000 (01:38 +0100)
Fixes invalid memcpy and out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/mss2dsp.c

index b18bf1f..c5fc1f8 100644 (file)
@@ -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);