[FFmpeg-devel] [PATCH] Merge (vp3|theora)_calculate_pixel_addresses

Michael Niedermayer michaelni
Wed Oct 8 22:46:35 CEST 2008


On Mon, Oct 06, 2008 at 02:06:59AM -0400, David Conrad wrote:
[...]
> index 6554264..7222648 100644
> --- a/libavcodec/xiph.c
> +++ b/libavcodec/xiph.c
> @@ -24,18 +24,29 @@ int ff_split_xiph_headers(uint8_t *extradata, int extradata_size,
>                            int first_header_size, uint8_t *header_start[3],
>                            int header_len[3])
>  {
> -    int i;
> +    int i, length;
> +	for (i = 0; i < 3; i++) {

tabs


> +        header_start[i] = extradata;
> +        header_len[i] = 0;
> +    }
> +
> +    if (extradata_size >= 2 && AV_RB16(extradata) == first_header_size) {
> +        int overall_len = 0;
> +        // It's not an error if we parse exactly all of the extradata without finding 3 packets

> +        for (i=0; i<3 && extradata_size - overall_len > 0; i++) {

extradata_size > overall_len

> +            // but it is an error if there's one byte left over
> +            if (extradata_size - overall_len < 2)
> +                return -1;

this check apears unneeded, it will be caught by the next one


> +
> +            length = AV_RB16(extradata);
> +            overall_len += length + 2;
> +            if (overall_len > extradata_size)
> +                return -1;

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

When the tyrant has disposed of foreign enemies by conquest or treaty, and
there is nothing more to fear from them, then he is always stirring up
some war or other, in order that the people may require a leader. -- Plato
-------------- 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/20081008/bd5d2ff4/attachment.pgp>



More information about the ffmpeg-devel mailing list