]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/lagarith.c
Merge commit 'a4d0c6e0503562d4cc8f9f6d02d84d7b32583b15'
[ffmpeg] / libavcodec / lagarith.c
index 0e6bb017183a9a4f094aae13a72d2ed1ae823efe..11d7791bfa41b7d76a07a723c125890296c9a770 100644 (file)
@@ -427,6 +427,7 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
     GetBitContext gb;
     lag_rac rac;
     const uint8_t *src_end = src + src_size;
+    int ret;
 
     rac.avctx = l->avctx;
     l->zeros = 0;
@@ -444,7 +445,8 @@ static int lag_decode_arith_plane(LagarithContext *l, uint8_t *dst,
             offset += 4;
         }
 
-        init_get_bits8(&gb, src + offset, src_size - offset);
+        if ((ret = init_get_bits8(&gb, src + offset, src_size - offset)) < 0)
+            return ret;
 
         if (lag_read_prob_header(&rac, &gb) < 0)
             return -1;