Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: Nasty bug in StillPicture()



Oliver Endriss schrieb:
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.

if (len < 0 || offs + len >= Length) {
free(buf);
return;
}
...


Thomas




--
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index