[FFmpeg-cvslog] avformat/movenc: Check that track_width_1616 fits within the available 32bit before storing it
Michael Niedermayer
git at videolan.org
Fri May 29 13:07:42 CEST 2015
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 29 12:54:37 2015 +0200| [061a592b9cb0071d624d230ddb5d00a640df05d1] | committer: Michael Niedermayer
avformat/movenc: Check that track_width_1616 fits within the available 32bit before storing it
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=061a592b9cb0071d624d230ddb5d00a640df05d1
---
libavformat/movenc.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 8b0a579..5491082 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);
More information about the ffmpeg-cvslog
mailing list