[FFmpeg-cvslog] avcodec/dsddec: Check channels

Michael Niedermayer git at videolan.org
Thu May 21 15:35:34 EEST 2020


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Mon May  4 00:04:49 2020 +0200| [2570a8777e7095358b10f679d35641e114a2ab33] | committer: Michael Niedermayer

avcodec/dsddec: Check channels

Fixes: division by zero
Fixes: 21677/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSD_MSBF_fuzzer-5712547983654912
Fixes: 21751/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DSD_LSBF_fuzzer-5197097180856320

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2570a8777e7095358b10f679d35641e114a2ab33
---

 libavcodec/dsddec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/dsddec.c b/libavcodec/dsddec.c
index 7c3ae15768..39837a5ad9 100644
--- a/libavcodec/dsddec.c
+++ b/libavcodec/dsddec.c
@@ -44,6 +44,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
     int i;
     uint8_t silence;
 
+    if (!avctx->channels)
+        return AVERROR_INVALIDDATA;
+
     ff_init_dsd_data();
 
     s = av_malloc_array(sizeof(DSDContext), avctx->channels);



More information about the ffmpeg-cvslog mailing list