aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-19 23:36:22 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-06 20:27:35 +0200
commitfde82db1692a78faee893fda7fb2f844d65b104c (patch)
treead0a6ab2dcc85f64f01dbf5b53ed69d244f05693
parent45a021aba12e32300e50002155d0cafb1ec154ab (diff)
downloadffmpeg-fde82db1692a78faee893fda7fb2f844d65b104c.tar.gz
avformat/cafdec: Do not store empty keys in read_info_chunk()
Fixes: Timeout Fixes: 45543/clusterfuzz-testcase-minimized-ffmpeg_dem_CAF_fuzzer-5684953164152832 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 7ec28e1d4cef723485f50f7a08859752b79b570c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/cafdec.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 7f09a27977..d18c3fce75 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -241,6 +241,8 @@ static void read_info_chunk(AVFormatContext *s, int64_t size)
char value[1024];
avio_get_str(pb, INT_MAX, key, sizeof(key));
avio_get_str(pb, INT_MAX, value, sizeof(value));
+ if (!*key)
+ continue;
av_dict_set(&s->metadata, key, value, 0);
}
}