OSDN Git Service

mjpegdec: fix memcmp size for *_count
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 27 Jan 2013 20:52:24 +0000 (21:52 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 27 Jan 2013 22:47:23 +0000 (23:47 +0100)
Fixes assertion failure

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

index 3042eb3..fc428df 100644 (file)
@@ -303,8 +303,8 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
 
     /* if different size, realloc/alloc picture */
     if (   width != s->width || height != s->height
-        || memcmp(s->h_count, h_count, sizeof(h_count[0])*nb_components)
-        || memcmp(s->v_count, v_count, sizeof(v_count[0])*nb_components)) {
+        || memcmp(s->h_count, h_count, sizeof(h_count))
+        || memcmp(s->v_count, v_count, sizeof(v_count))) {
         av_freep(&s->qscale_table);
 
         s->width      = width;