]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/smacker: Forward error codes
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Wed, 29 Jul 2020 20:00:31 +0000 (22:00 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 17 Sep 2020 23:46:44 +0000 (01:46 +0200)
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/smacker.c

index 07fa8887d8612f6263c17502e6fd60691f0d8ada..9ba70af6f703e8d21671f4cf60fa92076d832e69 100644 (file)
@@ -653,18 +653,15 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data,
             goto error;
         }
         skip_bits1(&gb);
-        if (smacker_decode_tree(&gb, &h[i], 0, 0) < 0) {
-            ret = AVERROR_INVALIDDATA;
+        if ((ret = smacker_decode_tree(&gb, &h[i], 0, 0)) < 0)
             goto error;
-        }
         skip_bits1(&gb);
         if(h[i].current > 1) {
-            res = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length,
+            ret = init_vlc(&vlc[i], SMKTREE_BITS, h[i].length,
                     h[i].lengths, sizeof(int), sizeof(int),
                     h[i].bits, sizeof(uint32_t), sizeof(uint32_t), INIT_VLC_LE);
-            if(res < 0) {
+            if (ret < 0) {
                 av_log(avctx, AV_LOG_ERROR, "Cannot build VLC table\n");
-                ret = AVERROR_INVALIDDATA;
                 goto error;
             }
         }