[FFmpeg-cvslog] avcodec/wmavoice: Check sample_rate

Michael Niedermayer git at videolan.org
Sat Nov 9 21:28:50 EET 2019


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Oct 23 22:32:47 2019 +0200| [55c97a763783540ee48a326a3e82fbdea42f8280] | committer: Michael Niedermayer

avcodec/wmavoice: Check sample_rate

Fixes: left shift of 538976288 by 8 places cannot be represented in type 'int'
Fixes: 18376/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMAVOICE_fuzzer-5741645391200256

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=55c97a763783540ee48a326a3e82fbdea42f8280
---

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

diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c
index 68bb65986e..4c147fe04f 100644
--- a/libavcodec/wmavoice.c
+++ b/libavcodec/wmavoice.c
@@ -433,6 +433,9 @@ static av_cold int wmavoice_decode_init(AVCodecContext *ctx)
         return AVERROR_INVALIDDATA;
     }
 
+    if (ctx->sample_rate >= INT_MAX / (256 * 37))
+        return AVERROR_INVALIDDATA;
+
     s->min_pitch_val    = ((ctx->sample_rate << 8)      /  400 + 50) >> 8;
     s->max_pitch_val    = ((ctx->sample_rate << 8) * 37 / 2000 + 50) >> 8;
     pitch_range         = s->max_pitch_val - s->min_pitch_val;



More information about the ffmpeg-cvslog mailing list