On Mon, 1 Jul 2024 at 12:16, Anton Khirnov <an...@khirnov.net> wrote: > > Quoting Kacper Michajłow (2024-06-02 03:38:18) > > 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. > > How? All this should be runtime-constant.
As we can read in hw_configs description. > Array of pointers to hardware configurations supported by the codec, or NULL > if no hardware supported. > The array is terminated by a NULL pointer. It uses for (i = 0;; i++), so it always gets the `public` address. Since public is the first member of `AVCodecHWConfigInternal`, it silently works; the offset of `public` is zero, so it remains NULL, and the check in the next line rejects it. Nevertheless, it is better to check it correctly as avcodec_get_hw_config() does. The "fails to initialize" part in the commit message is misleading. I think I just triggered this part of the code on some fallback path, but the value of hw_configs[i] is not affected by this. - Kacper _______________________________________________ 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".