mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
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>
This commit is contained in:
parent
ac9d159015
commit
6fc8226e29
@ -2199,6 +2199,10 @@ static int theora_decode_header(AVCodecContext *avctx, GetBitContext *gb)
|
|||||||
fps.num = get_bits_long(gb, 32);
|
fps.num = get_bits_long(gb, 32);
|
||||||
fps.den = get_bits_long(gb, 32);
|
fps.den = get_bits_long(gb, 32);
|
||||||
if (fps.num && fps.den) {
|
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,
|
av_reduce(&avctx->time_base.num, &avctx->time_base.den,
|
||||||
fps.den, fps.num, 1<<30);
|
fps.den, fps.num, 1<<30);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user