[FFmpeg-devel,2/4] avcodec/ra288: Check block_align for the assumed value

Submitted by Michael Niedermayer on Oct. 29, 2019, 10:35 p.m.

Details

Message ID 20191029223505.20667-2-michael@niedermayer.cc
State Accepted
Commit b6abdb1faf810e93189797a61af124fcd05269d4
Headers show

Commit Message

Michael Niedermayer Oct. 29, 2019, 10:35 p.m.
Fixes: Timeout (224sec -> 1ms)
Fixes: 18408/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_288_fuzzer-5740382570151936

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

Patch hide | download patch | download mbox

diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c
index f1b3c8eab5..aa4bd5d90f 100644
--- a/libavcodec/ra288.c
+++ b/libavcodec/ra288.c
@@ -77,7 +77,7 @@  static av_cold int ra288_decode_init(AVCodecContext *avctx)
     avctx->channel_layout = AV_CH_LAYOUT_MONO;
     avctx->sample_fmt     = AV_SAMPLE_FMT_FLT;
 
-    if (avctx->block_align <= 0) {
+    if (avctx->block_align != 38) {
         av_log(avctx, AV_LOG_ERROR, "unsupported block align\n");
         return AVERROR_PATCHWELCOME;
     }