[FFmpeg-cvslog] jpeg2000: zero reslevel array on allocation

Michael Niedermayer git at videolan.org
Fri Aug 23 18:13:07 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Aug 23 18:05:53 2013 +0200| [09927f3eaa93e31dd90ab8ee66dc1ad867b3365f] | committer: Michael Niedermayer

jpeg2000: zero reslevel array on allocation

prevent use of uninitialized values

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/jpeg2000.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index dc33110..77bf34e 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -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 */



More information about the ffmpeg-cvslog mailing list