Ticket #1482: sectionreader_validation.patch
File sectionreader_validation.patch, 1.7 KB (added by , 20 years ago) |
---|
-
libs/libmythtv/dvbsiparser.cpp
293 293 294 294 int rsz = read(pollArray[i].fd, &buffer, MAX_SECTION_SIZE); 295 295 296 if (rsz > 0) 296 // minimal valid DVB section is the TDT of size 8 297 if (rsz >= 8) 297 298 { 298 299 ParseTable(buffer, rsz, 299 300 PIDfilterManager[pollArray[i].fd].pid); … … 301 302 continue; 302 303 } 303 304 305 if (rsz > 0) 306 { 307 processed = true; 308 continue; 309 } 310 304 311 if (rsz == -1 && errno == EAGAIN) 305 312 { 306 313 i--; -
libs/libmythtv/siparser.cpp
521 521 * COMMON PARSER CODE 522 522 *------------------------------------------------------------------------*/ 523 523 524 void SIParser::ParseTable(uint8_t *buffer, int /*size*/, uint16_t pid)524 void SIParser::ParseTable(uint8_t *buffer, int size, uint16_t pid) 525 525 { 526 526 QMutexLocker locker(&pmap_lock); 527 527 528 528 const PESPacket pes = PESPacket::ViewData(buffer); 529 if (size != pes.Length()+3) 530 { 531 VERBOSE(VB_SIPARSER, LOC + "size of buffer and section_length do not" 532 " match. Probably a broken section."); 533 return; 534 } 529 535 const PSIPTable psip(pes); 530 536 531 537 if (!psip.SectionSyntaxIndicator())