diff options
author | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-04 09:32:21 +0100 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@gmail.com> | 2021-03-05 14:11:21 +0100 |
commit | 684e501cb9f1fb001228770d4e892f647de15202 (patch) | |
tree | 03148826e47e3d8c1a9502762175f1615463c300 /libavcodec/decode.c | |
parent | 94bf3f90e92437fe93ced2b2f058b13f4a290119 (diff) | |
download | ffmpeg-684e501cb9f1fb001228770d4e892f647de15202.tar.gz |
avcodec/decode: Return early upon failure
Allows to remove one level of indentation.
Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/decode.c')
-rw-r--r-- | libavcodec/decode.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 5e5d0c7066..db6ee9cb04 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -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++; |