From c551a2c62e173195598c7cbc54c182ec52b843ef Mon Sep 17 00:00:00 2001 From: Andreas Rheinhardt Date: Tue, 25 Mar 2025 07:44:24 +0100 Subject: [PATCH 18/44] avcodec/h263dec: Don't overwrite pix_fmt prematurely h263_get_format() did this (on one exit of the function): return avctx->pix_fmt = ff_get_format(); and ff_h263_decode_frame() calls it as follows: if (avctx->pix_fmt != h263_get_format(avctx)) It is not defined whether avctx->pix_fmt on the left is the old or the new value. Fix this by removing the assignment from h263_get_format(). Signed-off-by: Andreas Rheinhardt --- libavcodec/h263dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index 28e1cc2101..189016e143 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -83,7 +83,7 @@ static enum AVPixelFormat h263_get_format(AVCodecContext *avctx) if (avctx->codec_id == AV_CODEC_ID_H263 || avctx->codec_id == AV_CODEC_ID_H263P || avctx->codec_id == AV_CODEC_ID_MPEG4) - return avctx->pix_fmt = ff_get_format(avctx, h263_hwaccel_pixfmt_list_420); + return ff_get_format(avctx, h263_hwaccel_pixfmt_list_420); return AV_PIX_FMT_YUV420P; } -- 2.45.2