[FFmpeg-cvslog] avformat/rmenc: Check framerate before storing

Michael Niedermayer git at videolan.org
Mon Nov 28 00:29:16 EET 2016


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sun Nov 27 21:01:06 2016 +0100| [102f7d0ee62e28f7d2595e811b3a649b7383d657] | committer: Michael Niedermayer

avformat/rmenc: Check framerate before storing

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/rmenc.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c
index 3708f42..97ce711 100644
--- a/libavformat/rmenc.c
+++ b/libavformat/rmenc.c
@@ -253,6 +253,12 @@ static int rv10_write_header(AVFormatContext *ctx,
                 ffio_wfourcc(s,"RV20");
             avio_wb16(s, stream->par->width);
             avio_wb16(s, stream->par->height);
+
+            if (stream->frame_rate.num / stream->frame_rate.den > 65535) {
+                av_log(s, AV_LOG_ERROR, "Frame rate %d is too high\n", stream->frame_rate.num / stream->frame_rate.den);
+                return AVERROR(EINVAL);
+            }
+
             avio_wb16(s, stream->frame_rate.num / stream->frame_rate.den); /* frames per seconds ? */
             avio_wb32(s,0);     /* unknown meaning */
             avio_wb16(s, stream->frame_rate.num / stream->frame_rate.den);  /* unknown meaning */



More information about the ffmpeg-cvslog mailing list