aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/vivo.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2021-12-05 18:40:03 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-07 16:27:00 +0200
commit6cbacf1818ef11996845e644cbf69dbfe02be097 (patch)
tree43718792e15509d0621b662ffa43b58f586c4393 /libavformat/vivo.c
parente94ae6c679bffbddcb5662ae27903cc3555cdc31 (diff)
downloadffmpeg-6cbacf1818ef11996845e644cbf69dbfe02be097.tar.gz
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 7b24615565fd488e7e3a435102979a5ea85fe2fe) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/vivo.c')
-rw-r--r--libavformat/vivo.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libavformat/vivo.c b/libavformat/vivo.c
index 9a07c43849..09b593feb4 100644
--- a/libavformat/vivo.c
+++ b/libavformat/vivo.c
@@ -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"
@@ -204,11 +205,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)