[FFmpeg-cvslog] hq_hqa: Validate get_vlc2 return value

Luca Barbato git at videolan.org
Thu Apr 23 22:04:49 CEST 2015


ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Tue Apr 21 14:42:21 2015 +0200| [28eddef689f2b4843a84f7d05fd9614246f92cc4] | committer: Luca Barbato

hq_hqa: Validate get_vlc2 return value

The `hq_ac_vlc.table` is incomplete, so unaccounted symbol return -1
as value.

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

 libavcodec/hq_hqa.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavcodec/hq_hqa.c b/libavcodec/hq_hqa.c
index 4b18eae..ae378e6 100644
--- a/libavcodec/hq_hqa.c
+++ b/libavcodec/hq_hqa.c
@@ -75,7 +75,10 @@ static int hq_decode_block(HQContext *c, GetBitContext *gb, int16_t block[64],
     }
 
     for (;;) {
-        val  = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);
+        val = get_vlc2(gb, c->hq_ac_vlc.table, 9, 2);
+        if (val < 0)
+            return AVERROR_INVALIDDATA;
+
         pos += ff_hq_ac_skips[val];
         if (pos >= 64)
             break;



More information about the ffmpeg-cvslog mailing list