Răsfoiți Sursa

obs-qsv11: Check for null response on free

During destruction of the QSV_Encoder_Internal the response may not be
initialized and we can segfault. Add a check for this similar to the
Windows implementation.
Kurt Kartaltepe 1 an în urmă
părinte
comite
15ec21106a
1 a modificat fișierele cu 3 adăugiri și 0 ștergeri
  1. 3 0
      plugins/obs-qsv11/common_utils_linux.cpp

+ 3 - 0
plugins/obs-qsv11/common_utils_linux.cpp

@@ -210,6 +210,9 @@ mfxStatus simple_gethdl(mfxHDL pthis, mfxMemId mid, mfxHDL *handle)
 
 mfxStatus simple_free(mfxHDL pthis, mfxFrameAllocResponse *response)
 {
+	if (response == nullptr)
+		return MFX_ERR_NULL_PTR;
+
 	if (response->mids == nullptr || response->NumFrameActual == 0)
 		return MFX_ERR_NONE;