[FFmpeg-cvslog] jpeg2000: Fix unintended sign extension in malloc arguments of prec

Michael Niedermayer git at videolan.org
Mon Jun 3 15:00:26 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jun  3 14:30:09 2013 +0200| [234f76ae7debf2e9b057acff88125a7762f8741f] | committer: Michael Niedermayer

jpeg2000: Fix unintended sign extension in malloc arguments of prec

Fixes: CID1026772/3
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index c98b925..14f36c4 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -364,7 +364,7 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
                 band->coord[1][j] = ff_jpeg2000_ceildiv(band->coord[1][j], dy);
 
             band->prec = av_malloc_array(reslevel->num_precincts_x *
-                                         reslevel->num_precincts_y,
+                                         (uint64_t)reslevel->num_precincts_y,
                                          sizeof(*band->prec));
             if (!band->prec)
                 return AVERROR(ENOMEM);



More information about the ffmpeg-cvslog mailing list