Nvidia encoder crash
I've experienced crash in GStreamer code. Quick analyze shows that there is a bug in code causing this issue.
The problem are these two lines of code: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/1.20.4/subprojects/gst-plugins-bad/sys/nvcodec/gstnvbaseenc.c#L1176 (function gst_nv_base_enc_bitstream_thread
). The function _find_frame_with_output_buffer
can return NULL in some cases – this is obvious from it's code. But the following function gst_video_codec_frame_get_user_data
doesn't expect the NULL value.
Expected Behavior
Code handles unexpected state gracefully.
Observed Behavior
Crash.
Steps to reproduce the bug
I am not sure how to reproduce. I am sure this is an edge-case, but the problem in the code seems obvious.
How reproducible is the bug?
Only once