In some scenarios, the VVCContext.pix_fmt and the AVCodecContext.pix_fmt can get out-of-sync. It is more robust here to check the AVCodecContext.pix_fmt, as we already do for the width and height, seeing as the AVCodecContext.pix_fmt is the value which actually ends up being used to determine the number of channels in the allocated frame.
Fixes null dereferences if the chroma format changes mid-sequence. Signed-off-by: Frank Plowman <p...@frankplowman.com> --- libavcodec/vvc/dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/vvc/dec.c b/libavcodec/vvc/dec.c index 1cb168de7e..12a33ac798 100644 --- a/libavcodec/vvc/dec.c +++ b/libavcodec/vvc/dec.c @@ -802,7 +802,7 @@ static int export_frame_params(VVCContext *s, const VVCFrameContext *fc) int ret; // Reset HW config if pix_fmt/w/h change. - if (s->pix_fmt != sps->pix_fmt || c->coded_width != pps->width || c->coded_height != pps->height) { + if (c->pix_fmt != sps->pix_fmt || c->coded_width != pps->width || c->coded_height != pps->height) { c->coded_width = pps->width; c->coded_height = pps->height; ret = get_format(c, sps); -- 2.47.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".