SAT>IP client: add RTCP workaround for broken servers (minisatip)

This commit is contained in:
Jaroslav Kysela 2015-04-13 20:11:19 +02:00
parent 6751ade06e
commit daaebf916a

View file

@ -703,11 +703,12 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
if ((rtcp[0] & 0xc0) != 0x80) /* protocol version: v2 */
return;
l = (((rtcp[2] << 8) | rtcp[3]) + 1) * 4; /* length of payload */
if (l > len)
return;
if (rtcp[1] == 204 && l > 20 && /* packet type */
rtcp[8] == 'S' && rtcp[9] == 'E' &&
rtcp[10] == 'S' && rtcp[11] == '1') {
/* workaround for broken minisatip */
if (l > len && l - 4 != len)
return;
sl = (rtcp[14] << 8) | rtcp[15];
if (sl > 0 && l - 16 >= sl) {
rtcp[sl + 16] = '\0';