diff --git a/plugins/obs-ffmpeg/texture-amf.cpp b/plugins/obs-ffmpeg/texture-amf.cpp index db21494c6..e81f42fcd 100644 --- a/plugins/obs-ffmpeg/texture-amf.cpp +++ b/plugins/obs-ffmpeg/texture-amf.cpp @@ -633,6 +633,8 @@ static buf_t alloc_buf(amf_fallback *enc) size = enc->linesize * enc->cy * 4; } else if (enc->amf_format == AMF_SURFACE_P010) { size = enc->linesize * enc->cy * 2 * 2; + } else { + throw "Invalid amf_format"; } buf.resize(size); @@ -715,6 +717,11 @@ try { amf_trace->GetResultText(err.res)); *received_packet = false; return false; +} catch (const char *err) { + amf_fallback *enc = (amf_fallback *)data; + error("%s: %s", __FUNCTION__, err); + *received_packet = false; + return false; } static bool amf_extra_data(void *data, uint8_t **header, size_t *size)