Commit 5a4edf6f authored by Michael Niedermayer's avatar Michael Niedermayer

avformat/movenc: check that the video resolution is supported

Resolutions are stored as 16bit integers
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 1f935c3d
...@@ -4034,6 +4034,11 @@ static int mov_write_header(AVFormatContext *s) ...@@ -4034,6 +4034,11 @@ static int mov_write_header(AVFormatContext *s)
while(track->timescale < 10000) while(track->timescale < 10000)
track->timescale *= 2; 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) if (track->mode == MODE_MOV && track->timescale > 100000)
av_log(s, AV_LOG_WARNING, av_log(s, AV_LOG_WARNING,
"WARNING codec timebase is very high. If duration is too long,\n" "WARNING codec timebase is very high. If duration is too long,\n"
......
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