opusdec: Don't run vector_fmul_scalar on zero length arrays
authorKieran Kunhya <kierank@obe.tv>
Mon, 26 Oct 2015 23:09:44 +0000 (23:09 +0000)
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Thu, 26 Nov 2015 00:38:17 +0000 (01:38 +0100)
Fixes crashes on fuzzed files
Fixes Ticket4969 part2

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b3e5f15b95f04a35821f63f6fd89ddd60f666a59)
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
libavcodec/opusdec.c

index 7acc7cf..c22a2db 100644 (file)
@@ -589,7 +589,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));