1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

avformat/vivo: Do not use the general expression evaluator for parsing a floating point value

Fixes: Timeout
Fixes: 41564/clusterfuzz-testcase-minimized-ffmpeg_dem_VIVO_fuzzer-6309014024093696

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7b24615565)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2021-12-05 18:40:03 +01:00
parent f4f397ebc1
commit 88f619726c

View File

@ -26,6 +26,7 @@
* @sa http://wiki.multimedia.cx/index.php?title=Vivo
*/
#include "libavutil/avstring.h"
#include "libavutil/parseutils.h"
#include "avformat.h"
#include "internal.h"
@ -206,11 +207,12 @@ static int vivo_read_header(AVFormatContext *s)
return AVERROR_INVALIDDATA;
value_used = 1;
} else if (!strcmp(key, "FPS")) {
AVRational tmp;
double d;
if (av_sscanf(value, "%f", &d) != 1)
return AVERROR_INVALIDDATA;
value_used = 1;
if (!av_parse_ratio(&tmp, value, 10000, AV_LOG_WARNING, s))
fps = av_inv_q(tmp);
fps = av_inv_q(av_d2q(d, 10000));
}
if (!value_used)