aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/movenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-05-29 12:54:37 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-05-29 12:54:37 +0200
commit061a592b9cb0071d624d230ddb5d00a640df05d1 (patch)
treec389ed45953e6958e95327a8c2edcef2eb18624d /libavformat/movenc.c
parent14bc5704422415fddf1db5f5ae8e105183e0b582 (diff)
downloadffmpeg-061a592b9cb0071d624d230ddb5d00a640df05d1.tar.gz
avformat/movenc: Check that track_width_1616 fits within the available 32bit before storing it
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/movenc.c')
-rw-r--r--libavformat/movenc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8b0a57995e..5491082f1f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2371,7 +2371,9 @@ static int mov_write_tkhd_tag(AVIOContext *pb, MOVMuxContext *mov,
int64_t track_width_1616 = av_rescale(st->sample_aspect_ratio.num,
track->enc->width * 0x10000LL,
st->sample_aspect_ratio.den);
- if (!track_width_1616 || track->height != track->enc->height)
+ if (!track_width_1616 ||
+ track->height != track->enc->height ||
+ track_width_1616 > UINT32_MAX)
track_width_1616 = track->enc->width * 0x10000;
avio_wb32(pb, track_width_1616);
avio_wb32(pb, track->height * 0x10000);