aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-12-13 00:08:46 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2021-10-17 21:34:53 +0200
commitf5ed37fd0b8d17d886312dfba7fac0cfdbda5864 (patch)
treeda8667598865415a2b04042f2f4bd78758bcb853
parent897c1c990ae97636ced67f29fe13faaa0f31223c (diff)
downloadffmpeg-f5ed37fd0b8d17d886312dfba7fac0cfdbda5864.tar.gz
avformat/mov: Extend data_size check in mov_read_udta_string()
Fixes: signed integer overflow: -2147483634 - 16 cannot be represented in type 'int' Fixes: 28322/clusterfuzz-testcase-minimized-ffmpeg_dem_MOV_fuzzer-5711888402612224 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 74c4c539538e36d8df02de2484b045010d292f2c) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index e6d4e360cd..04af735591 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -356,7 +356,7 @@ retry:
if (c->itunes_metadata && atom.size > 8) {
int data_size = avio_rb32(pb);
int tag = avio_rl32(pb);
- if (tag == MKTAG('d','a','t','a') && data_size <= atom.size) {
+ if (tag == MKTAG('d','a','t','a') && data_size <= atom.size && data_size >= 16) {
data_type = avio_rb32(pb); // type
avio_rb32(pb); // unknown
str_size = data_size - 16;