[FFmpeg-cvslog] jpeg2000: Fix Unintended sign extension in malloc arguments of cblk.

Michael Niedermayer git at videolan.org
Mon Jun 3 14:29:16 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jun  3 14:16:19 2013 +0200| [d8c10324eda724b5a6e04477ed600dfb6804dd30] | committer: Michael Niedermayer

jpeg2000: Fix Unintended sign extension in malloc arguments of cblk.

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

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

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

diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index 26446cf..c98b925 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -420,7 +420,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
                     return AVERROR(ENOMEM);
 
                 prec->cblk = av_malloc_array(prec->nb_codeblocks_width *
-                                             prec->nb_codeblocks_height,
+                                             (uint64_t)prec->nb_codeblocks_height,
                                              sizeof(*prec->cblk));
                 if (!prec->cblk)
                     return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list