summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavcodec/cfhd.c21
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;
}