avcodec/amfdec: Check correct value, return error upon error

Found via an unused-variable warning from GCC.
Also just forward the error from amf_init_frames_context().

This bug has been introduced in
4479d28103.

Reviewed-by: Jan Ekström <jeebjp@gmail.com>
Reviewed-by: Mikhail Mironov <mikhail.mironov@amd.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt
2026-01-05 16:05:27 +01:00
parent d595a18287
commit 1461dfcde7

View File

@@ -644,9 +644,8 @@ static int amf_decode_frame(AVCodecContext *avctx, struct AVFrame *frame)
return AVERROR(EINVAL);
}
int ret = amf_init_frames_context(avctx, av_amf_to_av_format(format_var.int64Value), avctx->coded_width, avctx->coded_height);
if (res < 0)
return AVERROR(EINVAL);
if (ret < 0)
return ret;
}else
return AVERROR_EOF;
} else {