summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorU. Artie Eoff <ullysses.a.eoff@intel.com>2019-01-04 11:57:52 -0800
committerTim-Philipp Müller <tim@centricular.com>2019-05-02 11:53:32 +0100
commit6d35510a3666e6de697412c6334a65583fea4ffc (patch)
treeb141508495c73cd98699fd19bf6535d169953daa
parent201b8e075db5e97e0f5a40be9eb50688e4a7e948 (diff)
downloadgstreamer-plugins-bad-6d35510a3666e6de697412c6334a65583fea4ffc.tar.gz
msdkenc: break out of flush frames loop on error
In general, we should assume any unhandled error is non-recoverable. In the flush frames loop, some error states can cause us to never increment the task and therefore we get stuck in an infinite loop and generate GST_ELEMENT_ERROR over and over again. This eventually consumes all system memory and triggers OOM. Thus, assume the worst and break out of the loop upon the first "unhandled" error. https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/859
-rw-r--r--sys/msdk/gstmsdkenc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/msdk/gstmsdkenc.c b/sys/msdk/gstmsdkenc.c
index 9cbe6fe83..28ccc72db 100644
--- a/sys/msdk/gstmsdkenc.c
+++ b/sys/msdk/gstmsdkenc.c
@@ -803,6 +803,7 @@ gst_msdkenc_flush_frames (GstMsdkEnc * thiz, gboolean discard)
if (status != MFX_ERR_NONE && status != MFX_ERR_MORE_DATA) {
GST_ELEMENT_ERROR (thiz, STREAM, ENCODE, ("Encode frame failed."),
("MSDK encode error (%s)", msdk_status_to_string (status)));
+ break;
}
if (task->sync_point) {