Commit 17d32080 authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/movenc: Avoid integer overflow

Fixes: CID1361947
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 1a82d2cf
......@@ -2454,7 +2454,11 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
if (!track_width_1616 ||
track->height != track->par->height ||
track_width_1616 > UINT32_MAX)
track_width_1616 = track->par->width * 0x10000U;
track_width_1616 = track->par->width * 0x10000ULL;
if (track_width_1616 > UINT32_MAX) {
av_log(mov->fc, AV_LOG_WARNING, "track width too large\n");
track_width_1616 = 0;
}
avio_wb32(pb, track_width_1616);
avio_wb32(pb, track->height * 0x10000U);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment