From: He Junyan Date: Fri, 8 Jul 2022 14:05:12 +0000 (+0800) Subject: va: baseenc: Do not use codec frame structure again after finish_frame(). X-Git-Tag: 1.22.0~1285 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e2bbfed138cbcd69ca3a0246d32bb5bbc3b3a94;p=platform%2Fupstream%2Fgstreamer.git 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: --- diff --git a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c index cb3b70e..1a2ff73 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvabaseenc.c @@ -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; }