aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2013-09-16 20:58:38 +0300
committerMartin Storsjö <martin@martin.st>2013-09-18 11:30:06 +0300
commit0f310a6f333b016d336674d086045e8473fdf918 (patch)
treee92d9ec9856d430b786f0626078d1d7bef781831 /libavformat
parente7bf085b78586a04b918f4e76587779d04674700 (diff)
downloadffmpeg-0f310a6f333b016d336674d086045e8473fdf918.tar.gz
rmdec: Validate the fps value
Abort if it is invalid if strict error checking has been requested. Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/rmdec.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c
index afa37de736..d61f56908c 100644
--- a/libavformat/rmdec.c
+++ b/libavformat/rmdec.c
@@ -332,8 +332,13 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, AVIOContext *pb,
if ((ret = rm_read_extradata(pb, st->codec, codec_data_size - (avio_tell(pb) - codec_pos))) < 0)
return ret;
- av_reduce(&st->avg_frame_rate.den, &st->avg_frame_rate.num,
- 0x10000, fps, (1 << 30) - 1);
+ if (fps > 0) {
+ av_reduce(&st->avg_frame_rate.den, &st->avg_frame_rate.num,
+ 0x10000, fps, (1 << 30) - 1);
+ } else if (s->error_recognition & AV_EF_EXPLODE) {
+ av_log(s, AV_LOG_ERROR, "Invalid framerate\n");
+ return AVERROR_INVALIDDATA;
+ }
}
skip: