va: baseenc: Do not use codec frame structure again after finish_frame().

In _push_out_one_buffer(), we use codec frame structure again for error handling
after we already call finish_frame(), which is a latent segment fault.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2739>
This commit is contained in:
He Junyan 2022-07-08 22:05:12 +08:00 committed by GStreamer Marge Bot
parent 27c33f0161
commit 8e2bbfed13

View file

@ -494,15 +494,18 @@ _push_out_one_buffer (GstVaBaseEnc * base)
{
GstVideoCodecFrame *frame_out;
GstFlowReturn ret;
guint32 system_frame_number;
frame_out = g_queue_pop_head (&base->output_list);
gst_video_codec_frame_unref (frame_out);
system_frame_number = frame_out->system_frame_number;
ret = _push_buffer_to_downstream (base, frame_out);
if (ret != GST_FLOW_OK)
GST_ERROR_OBJECT (base, "fails to push one buffer, "
"system_frame_number %d", frame_out->system_frame_number);
"system_frame_number %d", system_frame_number);
return ret;
}