[FFmpeg-cvslog] avformat/movenc: check that the video resolution is supported

Michael Niedermayer git at videolan.org
Tue Jul 8 16:38:48 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jul  8 16:17:44 2014 +0200| [5a4edf6f0db78667895546c96d28a7d1c9adfaaa] | committer: Michael Niedermayer

avformat/movenc: check that the video resolution is supported

Resolutions are stored as 16bit integers

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5a4edf6f0db78667895546c96d28a7d1c9adfaaa
---

 libavformat/movenc.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index bb51574..919ae58 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -4034,6 +4034,11 @@ static int mov_write_header(AVFormatContext *s)
                 while(track->timescale < 10000)
                     track->timescale *= 2;
             }
+            if (st->codec->width > 65535 || st->codec->height > 65535) {
+                av_log(s, AV_LOG_ERROR, "Resolution %dx%d too large for mov/mp4\n", st->codec->width, st->codec->height);
+                ret = AVERROR(EINVAL);
+                goto error;
+            }
             if (track->mode == MODE_MOV && track->timescale > 100000)
                 av_log(s, AV_LOG_WARNING,
                        "WARNING codec timebase is very high. If duration is too long,\n"



More information about the ffmpeg-cvslog mailing list