[FFmpeg-cvslog] opusdec: Don't run vector_fmul_scalar on zero length arrays

Kieran Kunhya git at videolan.org
Thu Nov 12 04:07:43 CET 2015


ffmpeg | branch: release/2.7 | Kieran Kunhya <kierank at obe.tv> | Mon Oct 26 23:09:44 2015 +0000| [c3ce508135402282972449cf36f201c75f94fa48] | committer: Michael Niedermayer

opusdec: Don't run vector_fmul_scalar on zero length arrays

Fixes crashes on fuzzed files
Fixes Ticket4969 part2

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit b3e5f15b95f04a35821f63f6fd89ddd60f666a59)

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/opusdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 2ee3f2a..3f383ae 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -538,7 +538,7 @@ static int opus_decode_packet(AVCodecContext *avctx, void *data,
             memset(frame->extended_data[i], 0, frame->linesize[0]);
         }
 
-        if (c->gain_i) {
+        if (c->gain_i && decoded_samples > 0) {
             c->fdsp->vector_fmul_scalar((float*)frame->extended_data[i],
                                        (float*)frame->extended_data[i],
                                        c->gain, FFALIGN(decoded_samples, 8));



More information about the ffmpeg-cvslog mailing list