Don't throw away rtp packets from old Toxcore

This commit is contained in:
Robin Lindén 2018-03-05 22:51:06 +01:00 committed by iphydf
parent f5c24e577c
commit 5da8c8d5de
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -467,7 +467,8 @@ static int handle_rtp_packet(Messenger *m, uint32_t friendnumber, const uint8_t
return -1;
}
if (header.offset_full >= header.data_length_full) {
if (header.offset_full >= header.data_length_full
&& (header.offset_full != 0 || header.data_length_full != 0)) {
LOGGER_ERROR(m->log, "Invalid video packet: frame offset (%u) >= full frame length (%u)",
(unsigned)header.offset_full, (unsigned)header.data_length_full);
return -1;