Avoid segfaults due to unsigned integer underruns

Fix for bug 698.
This commit is contained in:
Moritz Bunkus 2012-01-07 15:44:51 +01:00
parent 6be52374a6
commit 6863f5fe2f
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2012-01-07 Moritz Bunkus <moritz@bunkus.org>
* mkvmerge: bug fix: Fixed a segmentation fault in the DTS
detection code. Fix for bug 698.
2012-01-05 Moritz Bunkus <moritz@bunkus.org>
* mkvextract: bug fix: The track IDs used in the "timecodes_v2"

View File

@ -316,7 +316,7 @@ find_consecutive_dts_headers(const unsigned char *buf,
int offset = dts_header.frame_byte_size;
unsigned int i;
for (i = 0; (num - 1) > i; ++i) {
if ((size - base - offset) < 2)
if (size < (2 + base + offset))
break;
pos = find_dts_header(&buf[base + offset], size - base - offset, &new_header, false);