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:
committed by
michaelni
parent
65ca8b1f50
commit
a3bfdd7318
@@ -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 &
|
||||
|
||||
Reference in New Issue
Block a user