Signed-off-by: Andreas Rheinhardt <andreas.rheinha...@gmail.com>
---
 libavcodec/smacker.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 8a4d88cfed..4b1f0f1b7c 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -251,17 +251,18 @@ static int smacker_decode_header_tree(SmackVContext *smk, 
GetBitContext *gb, int
         err = AVERROR(ENOMEM);
         goto error;
     }
+    *recodes = huff.values;
 
     res = smacker_decode_bigtree(gb, &huff, &ctx, 0);
-    if (res < 0)
+    if (res < 0) {
         err = res;
+        goto error;
+    }
     skip_bits1(gb);
     if(ctx.last[0] == -1) ctx.last[0] = huff.current++;
     if(ctx.last[1] == -1) ctx.last[1] = huff.current++;
     if(ctx.last[2] == -1) ctx.last[2] = huff.current++;
 
-    *recodes = huff.values;
-
 error:
     for (int i = 0; i < 2; i++) {
         if (vlc[i].table)
-- 
2.20.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to