]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/decode: Return early upon failure
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 4 Mar 2021 08:32:21 +0000 (09:32 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 5 Mar 2021 13:11:21 +0000 (14:11 +0100)
Allows to remove one level of indentation.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/decode.c

index 5e5d0c70660c4bb74e8bb87a2fc6362b212c1b3c..db6ee9cb042d4dca51cbca5499c5dc168e8b9d82 100644 (file)
@@ -1043,9 +1043,9 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
         AVPacket pkt_recoded = *avpkt;
 
         ret = recode_subtitle(avctx, &pkt_recoded, avpkt);
-        if (ret < 0) {
-            *got_sub_ptr = 0;
-        } else {
+        if (ret < 0)
+            return ret;
+
              ret = extract_packet_props(avctx->internal, &pkt_recoded);
              if (ret < 0)
                 return ret;
@@ -1099,7 +1099,6 @@ int avcodec_decode_subtitle2(AVCodecContext *avctx, AVSubtitle *sub,
 
                 av_packet_unref(&pkt_recoded);
             }
-        }
 
         if (*got_sub_ptr)
             avctx->frame_number++;