diff options
author | Martin Storsjö <martin@martin.st> | 2013-09-12 12:27:58 +0300 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2013-10-04 03:26:25 +0200 |
commit | b4c479a82adbb1301e3e549cd80cdd65208ddd05 (patch) | |
tree | aa73a5804e9fec1cbdf80c411cdac91e3a733214 | |
parent | 9f883e75e66a0cc0ddde78dabf52a8c78a25e9bb (diff) | |
download | ffmpeg-b4c479a82adbb1301e3e549cd80cdd65208ddd05.tar.gz |
vp3: Check the framerate for validity
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 6fc8226e29055858f28973bb3d27b63b3b65e616)
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
-rw-r--r-- | libavcodec/vp3.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 0340c22bb2..1d68c09ad6 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2160,6 +2160,10 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb) fps.num = get_bits_long(gb, 32); fps.den = get_bits_long(gb, 32); if (fps.num && fps.den) { + if (fps.num < 0 || fps.den < 0) { + av_log(avctx, AV_LOG_ERROR, "Invalid framerate\n"); + return AVERROR_INVALIDDATA; + } av_reduce(&avctx->time_base.num, &avctx->time_base.den, fps.den, fps.num, 1<<30); } |