diff options
author | Diego Biurrun <diego@biurrun.de> | 2016-03-03 17:37:05 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-07-25 13:56:59 +0200 |
commit | 9d4a85cbfb19c5e9f698713ce1ba707f5d527df0 (patch) | |
tree | 04e57f11a37130b6ef5f0359b666f7d051d2cbe2 | |
parent | 77f4ccb3e98d2adc9f5c5fdf031885d228549beb (diff) |
cfhd: Avoid a pointless goto
-rw-r--r-- | libavcodec/cfhd.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index 75d7ab33fc..07906b1eec 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -635,27 +635,25 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, /* Lowpass coefficients */ if (tag == 4 && data == 0xf0f && s->a_width && s->a_height) { if ((ret = read_lowpass_coeffs(avctx, s, &gb, coeff_data)) < 0) - goto end; + return ret; } if (tag == 55 && s->subband_num_actual != 255 && s->a_width && s->a_height) { if ((ret = read_highpass_coeffs(avctx, s, &gb, coeff_data)) < 0) - goto end; + return ret; } } if (!s->a_width || !s->a_height || s->a_format == AV_PIX_FMT_NONE || s->coded_width || s->coded_height || s->coded_format != AV_PIX_FMT_NONE) { av_log(avctx, AV_LOG_ERROR, "Invalid dimensions\n"); - ret = AVERROR_INVALIDDATA; - goto end; + return AVERROR_INVALIDDATA; } if (!got_buffer) { av_log(avctx, AV_LOG_ERROR, "No end of header tag found\n"); - ret = AVERROR_INVALIDDATA; - goto end; + return AVERROR_INVALIDDATA; } planes = av_pix_fmt_count_planes(avctx->pix_fmt); @@ -672,8 +670,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, s->plane[plane].band[0][1].width > s->plane[plane].band[0][1].a_width || !highpass_stride) { av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n"); - ret = AVERROR_INVALIDDATA; - goto end; + return AVERROR_INVALIDDATA; } av_log(avctx, AV_LOG_DEBUG, "Decoding level 1 plane %i %i %i %ti\n", @@ -731,8 +728,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, s->plane[plane].band[1][1].width > s->plane[plane].band[1][1].a_width || !highpass_stride) { av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n"); - ret = AVERROR_INVALIDDATA; - goto end; + return AVERROR_INVALIDDATA; } av_log(avctx, AV_LOG_DEBUG, "Level 2 plane %i %i %i %ti\n", plane, @@ -788,8 +784,7 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, s->plane[plane].band[2][1].width > s->plane[plane].band[2][1].a_width || !highpass_stride) { av_log(avctx, AV_LOG_ERROR, "Invalid plane dimensions\n"); - ret = AVERROR_INVALIDDATA; - goto end; + return AVERROR_INVALIDDATA; } av_log(avctx, AV_LOG_DEBUG, "Level 3 plane %i %i %i %ti\n", @@ -828,10 +823,6 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, } } -end: - if (ret < 0) - return ret; - *got_frame = 1; return avpkt->size; } |