On Wed, Jun 1, 2011 at 8:27 AM, Diego Biurrun <[email protected]> wrote:
>+                /* 000aabbb -> aa bbb aa  */
>+                *dst++ = (b << 3) | (b >> 2);
>+                *dst++ = (g << 3) | (g >> 2);
>+                *dst++ = (r << 3) | (r >> 2);

The comment is inconsistent with the code (the code is correct now);
it should be /* 000aaabb -> aaabbaaa */ (or just delete)..

> +static void flashsv2_prime(FlashSVContext *s, uint8_t *src,
> +                           int size, int unp_size)
> +{
> +    z_stream zs;
> +    uint8_t buf[65536 * 2];
> +    zs.zalloc = NULL;
> +    zs.zfree  = NULL;
> +    zs.opaque = NULL;
> +
> +    s->zstream.next_in   = src;
> +    s->zstream.avail_in  = size;
> +    s->zstream.next_out  = s->tmpblock;
> +    s->zstream.avail_out = s->block_size * 3;
> +    inflate(&(s->zstream), Z_SYNC_FLUSH);
> +
> +    deflateInit(&zs, 3);
> +    zs.next_in   = s->tmpblock;
> +    zs.avail_in  = s->block_size * 3 - s->zstream.avail_out;
> +    zs.next_out  = buf;
> +    zs.avail_out = sizeof(buf);
> +    deflate(&zs, Z_SYNC_FLUSH);
> +
> +    inflateReset(&s->zstream);
> +
> +    s->zstream.next_in   = buf;
> +    s->zstream.avail_in  = sizeof(buf) - zs.avail_out;
> +    s->zstream.next_out  = s->tmpblock;
> +    s->zstream.avail_out = s->block_size * 3;
> +    inflate(&(s->zstream), Z_SYNC_FLUSH);
> +}

Memory leak (missing deflateEnd).  This should be apparent pretty
quickly on a larger sample...

-- Daniel
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to