diff mbox series

[FFmpeg-devel,2/2] avformat/iff: Check block align also for ID_MAUD

Message ID 20210102012233.10261-2-michael@niedermayer.cc
State Accepted
Commit b17ffe8f8f30ba03901bcf7caa6c523e874e8fde
Headers show
Series [FFmpeg-devel,1/2] avformat/mvdec: Allocate extradata only once | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Michael Niedermayer Jan. 2, 2021, 1:22 a.m. UTC
Fixes: Timeout & OOM
Fixes: 28701/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5185094964871168

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/iff.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Jan. 23, 2021, 12:15 a.m. UTC | #1
On Sat, Jan 02, 2021 at 02:22:33AM +0100, Michael Niedermayer wrote:
> Fixes: Timeout & OOM
> Fixes: 28701/clusterfuzz-testcase-minimized-ffmpeg_dem_IFF_fuzzer-5185094964871168
> 
> Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  libavformat/iff.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

this fixes another sample as well
will apply

[...]
diff mbox series

Patch

diff --git a/libavformat/iff.c b/libavformat/iff.c
index 2dba121f6f..b07b6c8b18 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -763,7 +763,7 @@  static int iff_read_header(AVFormatContext *s)
         st->codecpar->bits_per_coded_sample = av_get_bits_per_sample(st->codecpar->codec_id);
         st->codecpar->bit_rate = (int64_t)st->codecpar->channels * st->codecpar->sample_rate * st->codecpar->bits_per_coded_sample;
         st->codecpar->block_align = st->codecpar->channels * st->codecpar->bits_per_coded_sample;
-        if (st->codecpar->codec_tag == ID_DSD && st->codecpar->block_align <= 0)
+        if ((st->codecpar->codec_tag == ID_DSD || st->codecpar->codec_tag == ID_MAUD) && st->codecpar->block_align <= 0)
             return AVERROR_INVALIDDATA;
         break;