On Saturday 18 October 2003 14:57, Thomas Heiligenmann wrote:
Oops - just seen it. Here comes the updated patch :-)
I suggest to stop scanning immediately if we encounter an error.
For example (MPEG-2 case):
if ((Data[i + 6] & 0xC0) == 0x80) {
// MPEG-2 PES header
if (i + 8 >= Length)
break;
offs += 3;
offs += Data[i + 8];
len -= 3;
len -= Data[i + 8];
if (len < 0 || offs + len >= Length)
break;
}
else {
// MPEG-1 PES header
...
Wouldn't it be better then to "return" immediately? After "break"-ing
the "while" loop a part of the (erratic) stream would be sent to the
driver anyway.