Commit 19f27f94 authored by Stéphane Cerveau's avatar Stéphane Cerveau 🤸🏻 Committed by GStreamer Merge Bot

videoencoder: protect the use of num_subframes

change stream lock location to protect the use of
frame->abidata.ABI.num_subframes
parent 8df947df
......@@ -2486,6 +2486,8 @@ gst_video_encoder_finish_subframe (GstVideoEncoder * encoder,
g_return_val_if_fail (frame->output_buffer, GST_FLOW_ERROR);
subframe_buffer = frame->output_buffer;
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
discont = (frame->presentation_frame_number == 0
&& frame->abidata.ABI.num_subframes == 0);
......@@ -2497,8 +2499,6 @@ gst_video_encoder_finish_subframe (GstVideoEncoder * encoder,
frame->presentation_frame_number, GST_TIME_ARGS (frame->pts),
GST_TIME_ARGS (frame->dts), GST_VIDEO_CODEC_FRAME_IS_SYNC_POINT (frame));
GST_VIDEO_ENCODER_STREAM_LOCK (encoder);
ret = gst_video_encoder_can_push_unlocked (encoder);
if (ret != GST_FLOW_OK)
goto done;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment