avcodec/loco: check the init_get_bits8() return code
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 31 Dec 2014 14:12:58 +0000 (15:12 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 31 Dec 2014 14:42:17 +0000 (15:42 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/loco.c

index 9b73598..aea478d 100644 (file)
@@ -130,12 +130,15 @@ static int loco_decode_plane(LOCOContext *l, uint8_t *data, int width, int heigh
 {
     RICEContext rc;
     int val;
+    int ret;
     int i, j;
 
     if(buf_size<=0)
         return -1;
 
-    init_get_bits8(&rc.gb, buf, buf_size);
+    if ((ret = init_get_bits8(&rc.gb, buf, buf_size)) < 0)
+        return ret;
+
     rc.save  = 0;
     rc.run   = 0;
     rc.run2  = 0;