1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

avcodec/decode: use avcodec_get_hw_config() in avcodec_default_get_format()

This is not a security issue.

Fixes: e5BUoyG1Jo3N
Fixes: swarm-NULL-pointer-dereference-in-hw_configs-iteration-0b77cc
Regression since: 67e81d79cc
NULL pointer member access Replicated through API with UBSAN
Found-by: zhang xingxing <2388969553@qq.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer
2026-10-13 06:39:23 +02:00
committed by michaelni
parent 65ca8b1f50
commit a3bfdd7318

View File

@@ -1019,7 +1019,7 @@ enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *avctx,
AVHWDeviceContext *device_ctx =
(AVHWDeviceContext*)avctx->hw_device_ctx->data;
for (i = 0;; i++) {
config = &ffcodec(avctx->codec)->hw_configs[i]->public;
config = avcodec_get_hw_config(avctx->codec, i);
if (!config)
break;
if (!(config->methods &