jpeg2000: zero reslevel array on allocation
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 23 Aug 2013 16:05:53 +0000 (18:05 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 23 Aug 2013 16:06:54 +0000 (18:06 +0200)
prevent use of uninitialized values

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/jpeg2000.c

index dc33110..77bf34e 100644 (file)
@@ -224,7 +224,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
         if (!comp->i_data)
             return AVERROR(ENOMEM);
     }
-    comp->reslevel = av_malloc_array(codsty->nreslevels, sizeof(*comp->reslevel));
+    comp->reslevel = av_calloc(codsty->nreslevels, sizeof(*comp->reslevel));
     if (!comp->reslevel)
         return AVERROR(ENOMEM);
     /* LOOP on resolution levels */