[FFmpeg-cvslog] vima: check packet size before initializing bitstream reader

Paul B Mahol git at videolan.org
Sun Sep 30 19:32:07 CEST 2012


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Sun Sep 30 15:14:28 2012 +0000| [857797bc1455468f9d70565ac087c3f57d8e67ff] | committer: Paul B Mahol

vima: check packet size before initializing bitstream reader

Signed-off-by: Paul B Mahol <onemda at gmail.com>

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

 libavcodec/vima.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vima.c b/libavcodec/vima.c
index 3005198..648ae55 100644
--- a/libavcodec/vima.c
+++ b/libavcodec/vima.c
@@ -141,11 +141,11 @@ static int decode_frame(AVCodecContext *avctx, void *data,
     int8_t         channel_hint[2];
     int            ret, chan, channels = 1;
 
-    init_get_bits(&gb, pkt->data, pkt->size * 8);
-
     if (pkt->size < 13)
         return AVERROR_INVALIDDATA;
 
+    init_get_bits(&gb, pkt->data, pkt->size * 8);
+
     samples = get_bits_long(&gb, 32);
     if (samples == 0xffffffff) {
         skip_bits_long(&gb, 32);



More information about the ffmpeg-cvslog mailing list