Fixes libavcodec/decode.c:1035:61: runtime error: member access within null pointer of type 'const struct AVCodecHWConfigInternal'.
This can happen when hwaccel fails to initialize and hw_configs[i] is NULL. Signed-off-by: Kacper Michajłow <kaspe...@gmail.com> --- libavcodec/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/decode.c b/libavcodec/decode.c index 791940648d..ced4ff3421 100644 --- a/libavcodec/decode.c +++ b/libavcodec/decode.c @@ -1032,7 +1032,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 & -- 2.43.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".