aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-23 01:08:56 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-12 22:02:28 +0200
commit06bd0a44a8a0289afe2ab7a66a62bdde4517207d (patch)
tree032e6c5b4ebb2bd9fcad0fd00a011ca4b6ce86a9
parent6ee5e7a6966efed7d8f14d92a6d22c76d3168540 (diff)
downloadffmpeg-06bd0a44a8a0289afe2ab7a66a62bdde4517207d.tar.gz
avformat/aiffdec: avoid integer overflow in get_meta()
Fixes: signed integer overflow: 2147483647 + 1 cannot be represented in type 'int' Fixes: 45891/clusterfuzz-testcase-minimized-ffmpeg_dem_AIFF_fuzzer-6159183893889024 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 6a02de21278ec3bea1d2c62665f2629d5a62210f) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/aiffdec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index c7572058cc..0a874c4e94 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -73,7 +73,7 @@ static int get_tag(AVIOContext *pb, uint32_t * tag)
/* Metadata string read */
static void get_meta(AVFormatContext *s, const char *key, int size)
{
- uint8_t *str = av_malloc(size+1);
+ uint8_t *str = av_malloc(size+1U);
if (str) {
int res = avio_read(s->pb, str, size);