[FFmpeg-cvslog] utvideoenc: fix theoretical integer overflow

Michael Niedermayer git at videolan.org
Fri Oct 19 19:02:18 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Oct 19 18:44:28 2012 +0200| [0fa26bd4703cf8ee84ae9b9859be2b4e0e77d42f] | committer: Michael Niedermayer

utvideoenc: fix theoretical integer overflow

The image sizes needed for this overflow to happen are currently not
supported in lavc, thus this should have no effect execpt making the
code more robust in light of future changes.

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

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

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

diff --git a/libavcodec/utvideoenc.c b/libavcodec/utvideoenc.c
index 14d301e..7167278 100644
--- a/libavcodec/utvideoenc.c
+++ b/libavcodec/utvideoenc.c
@@ -417,7 +417,7 @@ static int encode_plane(AVCodecContext *avctx, uint8_t *src,
         /* If non-zero count is found, see if it matches width * height */
         if (counts[symbol]) {
             /* Special case if only one symbol was used */
-            if (counts[symbol] == width * height) {
+            if (counts[symbol] == width * (int64_t)height) {
                 /*
                  * Write a zero for the single symbol
                  * used in the plane, else 0xFF.



More information about the ffmpeg-cvslog mailing list