Re: [FFmpeg-devel] [PATCH 5/7] cbs_mpeg2: Fix parsing the last unit

2019-07-29 Thread Mark Thompson
On 29/07/2019 20:56, Andreas Rheinhardt wrote: > There is one way to find out if avpriv_find_start_code has found a start > code or not: One has to check whether the state variable contains a > start code, i.e. whether the three most serious bytes are 0x00 00 01. "most significant bytes" > Checki

[FFmpeg-devel] [PATCH 5/7] cbs_mpeg2: Fix parsing the last unit

2019-07-29 Thread Andreas Rheinhardt
There is one way to find out if avpriv_find_start_code has found a start code or not: One has to check whether the state variable contains a start code, i.e. whether the three most serious bytes are 0x00 00 01. Checking for whether the return value is the end of the designated buffer is not enough: