diff mbox series

[FFmpeg-devel,8/8] avcodec/smacker: Forward error codes

Message ID 20200731112241.8948-8-andreas.rheinhardt@gmail.com
State Accepted
Commit 056a8fc07133148f6cb1f2ea157a6b91c33e5b02
Headers show
Series [FFmpeg-devel,1/8] avcodec/smacker: Remove write-only and unused variables | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt July 31, 2020, 11:22 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/smacker.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Comments

Paul B Mahol Aug. 1, 2020, 9:25 a.m. UTC | #1
lgtm

On 7/31/20, Andreas Rheinhardt <andreas.rheinhardt@gmail.com> wrote:
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
> ---
>  libavcodec/smacker.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
> index 07fa8887d8..9ba70af6f7 100644
> --- a/libavcodec/smacker.c
> +++ b/libavcodec/smacker.c
> @@ -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;
>              }
>          }
> --
> 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-request@ffmpeg.org with subject "unsubscribe".
diff mbox series

Patch

diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c
index 07fa8887d8..9ba70af6f7 100644
--- a/libavcodec/smacker.c
+++ b/libavcodec/smacker.c
@@ -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;
             }
         }