[FFmpeg-cvslog] opus: Do not call vector_fmul_scalar on zero samples

Kieran Kunhya git at videolan.org
Thu Oct 29 14:26:12 CET 2015


ffmpeg | branch: master | Kieran Kunhya <kierank at obe.tv> | Wed Oct 28 17:01:56 2015 +0100| [b8deb7c34f755d5e3eee0b5930c3a6ad2dda96bc] | committer: Luca Barbato

opus: Do not call vector_fmul_scalar on zero samples

The x86 variant of this function crashes in that specific case.

CC: libav-devel at libav.org

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

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

diff --git a/libavcodec/opusdec.c b/libavcodec/opusdec.c
index 919e5e3..92e651c 100644
--- a/libavcodec/opusdec.c
+++ b/libavcodec/opusdec.c
@@ -587,7 +587,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