[FFmpeg-devel] [PATCH] Off by one in mpeg video parsing (r17731)

Michael Niedermayer michaelni
Tue May 5 01:53:18 CEST 2009


On Mon, May 04, 2009 at 08:47:11PM -0000, Wolfram Gloger wrote:
> Hi,
> 
> I believe r17731 introduced an off-by-one error.
> It introduced in mpeg12.c:
> 
> @@ -2244,6 +2244,9 @@
>                      return i-3;
>                  }
>              }
> +            if(s && state == PICTURE_START_CODE){
> +                ff_fetch_timestamp(s, i-4, 1);
> +            }
>          }
>      }
>      pc->state= state;
> 
> however, as is apparent from the surrounding code, the index that
> "points" to PICTURE_START_CODE is actually i-3 and not i-4.
> The effect of this is that when a PES packet starts with
> PICTURE_START_CODE (very common e.g. in DVB), the timestamps
> are fetched from the _previous_ PES packet (offset==-1),
> which is wrong IMHO.

a reproducable testcase would be nice

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

While the State exists there can be no freedom; when there is freedom there
will be no State. -- Vladimir Lenin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090505/c1dcd98a/attachment.pgp>



More information about the ffmpeg-devel mailing list