obs-ffmpeg: Throw on invalid amf_format

This commit is contained in:
Richard Stanway 2022-07-23 00:33:50 +02:00 committed by Jim
parent ac025b51ac
commit 68415fa08f

View File

@ -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)