[FFmpeg-cvslog] avcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit

Michael Niedermayer git at videolan.org
Tue Jan 10 15:32:55 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Jan  8 16:37:56 2017 +0100| [f48b6b8b91d63148ef50d096688ed7226cd6ddf4] | committer: Michael Niedermayer

avcodec/tiff: Perform multiply in tiff_unpack_lzma() as 64bit

This should make no difference as the value should not be able to be that large
but its more correct this way

Fixes CID1348138

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
index 7ccda51..efbd979 100644
--- a/libavcodec/tiff.c
+++ b/libavcodec/tiff.c
@@ -408,7 +408,7 @@ static int tiff_unpack_lzma(TiffContext *s, AVFrame *p, uint8_t *dst, int stride
                             const uint8_t *src, int size, int width, int lines,
                             int strip_start, int is_yuv)
 {
-    uint64_t outlen = width * lines;
+    uint64_t outlen = width * (uint64_t)lines;
     int ret, line;
     uint8_t *buf = av_malloc(outlen);
     if (!buf)



More information about the ffmpeg-cvslog mailing list