diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-07-12 14:01:35 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-07-25 13:57:02 +0200 |
commit | e8198d900bd971882a32d09259ddf6560f537c77 (patch) | |
tree | 0b767f51248050225ed09eb70b30e1f56f3de792 | |
parent | 4d6e35f434b6eca7a3384ff517c57cc8097395a3 (diff) |
cfhd: drop pointless conditions
They are always true at that point.
-rw-r--r-- | libavcodec/cfhd.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/libavcodec/cfhd.c b/libavcodec/cfhd.c index febb0c2b6b..3b9b56d46d 100644 --- a/libavcodec/cfhd.c +++ b/libavcodec/cfhd.c @@ -727,23 +727,22 @@ static int cfhd_decode(AVCodecContext *avctx, void *data, int *got_frame, s->coded_format = AV_PIX_FMT_NONE; while (bytestream2_get_bytes_left(&gb) > 4) { + int16_t *coeff_data; + if ((ret = parse_tag(s, &gb, &tag, &value, &planes)) < 0) break; - if (s->a_width && s->a_height) { - int16_t *coeff_data = s->plane[s->channel_num].subband[s->subband_num_actual]; - if (tag == 4 && value == 0x0F0F) { - if ((ret = read_lowpass_coeffs(s, &gb, coeff_data)) < 0) - return ret; - } else if (tag == 55 && s->subband_num_actual != 255) { - if ((ret = read_highpass_coeffs(s, &gb, coeff_data)) < 0) - return ret; - } + coeff_data = s->plane[s->channel_num].subband[s->subband_num_actual]; + if (tag == 4 && value == 0x0F0F) { + if ((ret = read_lowpass_coeffs(s, &gb, coeff_data)) < 0) + return ret; + } else if (tag == 55 && s->subband_num_actual != 255) { + if ((ret = read_highpass_coeffs(s, &gb, coeff_data)) < 0) + 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) { + if (s->coded_width || s->coded_height || s->coded_format != AV_PIX_FMT_NONE) { av_log(avctx, AV_LOG_ERROR, "Invalid dimensions\n"); return AVERROR_INVALIDDATA; } |