[FFmpeg-cvslog] mss2dsp/upsample_plane: fix 0x0 handling

Michael Niedermayer git at videolan.org
Wed Mar 6 01:49:05 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Mar  6 01:37:49 2013 +0100| [7bab631f7df55b361368296f125b95a1814bc18c] | committer: Michael Niedermayer

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 <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7bab631f7df55b361368296f125b95a1814bc18c
---

 libavcodec/mss2dsp.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/mss2dsp.c b/libavcodec/mss2dsp.c
index b18bf1f..c5fc1f8 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);
 



More information about the ffmpeg-cvslog mailing list