[FFmpeg-devel] [PATCH 4/4] movenc: check that fps for tmcd is within encodable range.

Michael Niedermayer michaelni at gmx.at
Thu Jan 17 19:01:38 CET 2013


Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 libavformat/movenc.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index d9b002e..b44f316 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -1149,6 +1149,9 @@ static int mov_write_tmcd_tag(AVIOContext *pb, MOVTrack *track)
     int frame_duration = av_rescale(track->timescale, track->enc->time_base.num, track->enc->time_base.den);
     int nb_frames = 1.0/av_q2d(track->enc->time_base) + 0.5;
 
+    if (nb_frames > 255)
+        return AVERROR(EINVAL);
+
     avio_wb32(pb, 0); /* size */
     ffio_wfourcc(pb, "tmcd");               /* Data format */
     avio_wb32(pb, 0);                       /* Reserved */
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list