mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
deinterlace: Don't leak frame in error case
CID #1455494 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/581>
This commit is contained in:
parent
cfb9a5d53a
commit
518d192dc5
1 changed files with 6 additions and 2 deletions
|
@ -1082,8 +1082,12 @@ gst_deinterlace_push_history (GstDeinterlace * self, GstBuffer * buffer)
|
||||||
onefield = GST_VIDEO_FRAME_IS_ONEFIELD (frame);
|
onefield = GST_VIDEO_FRAME_IS_ONEFIELD (frame);
|
||||||
fields_to_push = (onefield) ? 1 : 2;
|
fields_to_push = (onefield) ? 1 : 2;
|
||||||
|
|
||||||
g_return_if_fail (self->history_count <
|
if (G_UNLIKELY (self->history_count >=
|
||||||
GST_DEINTERLACE_MAX_FIELD_HISTORY - fields_to_push);
|
GST_DEINTERLACE_MAX_FIELD_HISTORY - fields_to_push)) {
|
||||||
|
GST_WARNING_OBJECT (self, "history count exceeded limit");
|
||||||
|
gst_video_frame_unmap_and_free (frame);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
gst_deinterlace_get_buffer_state (self, frame, &buf_state, &interlacing_mode);
|
gst_deinterlace_get_buffer_state (self, frame, &buf_state, &interlacing_mode);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue