wavpack: check that all the channels were coded.
authorAnton Khirnov <anton@khirnov.net>
Mon, 27 May 2013 17:13:14 +0000 (19:13 +0200)
committerAnton Khirnov <anton@khirnov.net>
Tue, 28 May 2013 15:47:24 +0000 (17:47 +0200)
libavcodec/wavpack.c

index 7a14519..0847238 100644 (file)
@@ -1212,6 +1212,11 @@ static int wavpack_decode_frame(AVCodecContext *avctx, void *data,
         buf_size -= frame_size;
     }
 
+    if (s->ch_offset != avctx->channels) {
+        av_log(avctx, AV_LOG_ERROR, "Not enough channels coded in a packet.\n");
+        return AVERROR_INVALIDDATA;
+    }
+
     *got_frame_ptr = 1;
 
     return avpkt->size;