Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-17 03:23:43 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2015-12-17 04:07:41 +0300
commit6ea7dd25c773145b50eed55c2059647bb086aaca (patch)
treedbd2f293780eb0b8892add6af0b24a9927dc9f37 /libavformat
parent25f6ccccd69038f80450351f69b8225df6042d68 (diff)
avformat/swfenc: Check frama rate before writing it
Fixes assertion failure with ffserver Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/swfenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c
index 56d9879017..8d5933e9bf 100644
--- a/libavformat/swfenc.c
+++ b/libavformat/swfenc.c
@@ -256,6 +256,10 @@ static int swf_write_header(AVFormatContext *s)
(will be patched if not streamed) */
put_swf_rect(pb, 0, width * 20, 0, height * 20);
+ if ((rate * 256LL) / rate_base >= (1<<16)) {
+ av_log(s, AV_LOG_ERROR, "Invalid (too large) frame rate %d/%d\n", rate, rate_base);
+ return AVERROR(EINVAL);
+ }
avio_wl16(pb, (rate * 256) / rate_base); /* frame rate */
swf->duration_pos = avio_tell(pb);
avio_wl16(pb, (uint16_t)(DUMMY_DURATION * (int64_t)rate / rate_base)); /* frame count */