avformat/movenc: Fix potential signed overflows

Fixes CID1302838

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2015-06-01 17:54:58 +02:00
parent 138581c41a
commit 627dd7fe7e
1 changed files with 2 additions and 2 deletions

View 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)
track_width_1616 = track->enc->width * 0x10000;
track_width_1616 = track->enc->width * 0x10000U;
avio_wb32(pb, track_width_1616);
avio_wb32(pb, track->height * 0x10000);
avio_wb32(pb, track->height * 0x10000U);
}
} else {
avio_wb32(pb, 0);