diff mbox series

[FFmpeg-devel,2/2] avcodec/decode: Avoid ffcodec()

Message ID DU0P250MB0747CEDC202D083D06667F288FDA2@DU0P250MB0747.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,1/2] avcodec/decode: Fix member access within null pointer | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 fail Make fate failed
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt July 8, 2024, 4:14 p.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavcodec/decode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index cdb682cf69..187b5b6c85 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -1029,7 +1029,7 @@  enum AVPixelFormat avcodec_default_get_format(struct AVCodecContext *avctx,
 
     // If a device was supplied when the codec was opened, assume that the
     // user wants to use it.
-    if (avctx->hw_device_ctx && ffcodec(avctx->codec)->hw_configs) {
+    if (avctx->hw_device_ctx && codec->hw_configs) {
         AVHWDeviceContext *device_ctx =
             (AVHWDeviceContext*)avctx->hw_device_ctx->data;
         for (size_t i = 0; codec->hw_configs[i]; i++) {