[FFmpeg-cvslog] lavf/matroskaenc: check for overflow in display width.
Nicolas George
git at videolan.org
Thu Dec 13 12:50:51 CET 2012
ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Dec 12 21:19:24 2012 +0100| [2dbc84b1a8d39e7fa0c7d66a120838fced35f5b4] | committer: Nicolas George
lavf/matroskaenc: check for overflow in display width.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2dbc84b1a8d39e7fa0c7d66a120838fced35f5b4
---
libavformat/matroskaenc.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index adca74f..c0c0a2d 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -637,7 +637,11 @@ static int mkv_write_tracks(AVFormatContext *s)
}
if (st->sample_aspect_ratio.num) {
- int d_width = av_rescale(codec->width, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
+ int64_t d_width = av_rescale(codec->width, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
+ if (d_width > INT_MAX) {
+ av_log(s, AV_LOG_ERROR, "Overflow in display width\n");
+ return AVERROR(EINVAL);
+ }
put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYWIDTH , d_width);
put_ebml_uint(pb, MATROSKA_ID_VIDEODISPLAYHEIGHT, codec->height);
}
More information about the ffmpeg-cvslog
mailing list