mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-23 02:01:12 +00:00
codecs: AV1: Ensure current picture and frame to NULL before return
The current code fails to clear the current picture and frame pointer if some flow error such as EOS happens. This causes the double free issue in gst_av1_decoder_reset(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5104>
This commit is contained in:
parent
8846400b83
commit
5aa2239c4b
1 changed files with 4 additions and 3 deletions
|
@ -787,15 +787,16 @@ out:
|
||||||
|
|
||||||
gst_av1_decoder_drain_output_queue (self,
|
gst_av1_decoder_drain_output_queue (self,
|
||||||
priv->preferred_output_delay, &output_ret);
|
priv->preferred_output_delay, &output_ret);
|
||||||
|
|
||||||
|
priv->current_picture = NULL;
|
||||||
|
priv->current_frame = NULL;
|
||||||
|
|
||||||
if (output_ret != GST_FLOW_OK) {
|
if (output_ret != GST_FLOW_OK) {
|
||||||
GST_DEBUG_OBJECT (self,
|
GST_DEBUG_OBJECT (self,
|
||||||
"Output returned %s", gst_flow_get_name (output_ret));
|
"Output returned %s", gst_flow_get_name (output_ret));
|
||||||
return output_ret;
|
return output_ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
priv->current_picture = NULL;
|
|
||||||
priv->current_frame = NULL;
|
|
||||||
|
|
||||||
if (ret == GST_FLOW_ERROR) {
|
if (ret == GST_FLOW_ERROR) {
|
||||||
GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE,
|
GST_VIDEO_DECODER_ERROR (decoder, 1, STREAM, DECODE,
|
||||||
("Failed to handle the frame %d", frame->system_frame_number),
|
("Failed to handle the frame %d", frame->system_frame_number),
|
||||||
|
|
Loading…
Reference in a new issue