avformat/movenc: Fix potential signed overflows
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Jun 2015 15:54:58 +0000 (17:54 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 1 Jun 2015 15:54:58 +0000 (17:54 +0200)
Fixes CID1302838

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/movenc.c

index cfd53f1..9b2c8da 100644 (file)
@@ -2374,9 +2374,9 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
             if (!track_width_1616 ||
                 track->height != track->enc->height ||
                 track_width_1616 > UINT32_MAX)
             if (!track_width_1616 ||
                 track->height != track->enc->height ||
                 track_width_1616 > UINT32_MAX)
-                track_width_1616 = track->enc->width * 0x10000;
+                track_width_1616 = track->enc->width * 0x10000U;
             avio_wb32(pb, track_width_1616);
             avio_wb32(pb, track_width_1616);
-            avio_wb32(pb, track->height * 0x10000);
+            avio_wb32(pb, track->height * 0x10000U);
         }
     } else {
         avio_wb32(pb, 0);
         }
     } else {
         avio_wb32(pb, 0);