[Ffmpeg-devel] [PATCH] ported SGI decoder to the new API

Xiaohui Sun sunxiaohui
Thu Apr 5 13:23:44 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Michael Niedermayer wrote:
> Hi
> 
> On Thu, Apr 05, 2007 at 09:42:59AM +0800, Xiaohui Sun wrote:
> [...]
>
>> +    uint8_t *ptr = in_buf;
>> +    unsigned int offset = s->height * s->width;
>> +
>> +    /* test buffer size */
>> +    if (offset * s->depth > end_buf - in_buf) {
>> +       return -1;
>> +    }
>> +
>> +    for (y = s->height - 1; y >= 0; y--) {
> 
>> +        dest_row = out_ptr + (y * FFABS(s->linesize));
> 
> this looks wrong

the output image can also be flipped, that is the dest_row can be less
than the out_ptr, which points to p->data[0]?


[...]

> [...]
>> +    dimension = bytestream_get_be16(&in_buf);
>> +    s->width = bytestream_get_be16(&in_buf);
>> +    s->height = bytestream_get_be16(&in_buf);
>> +    s->depth = bytestream_get_be16(&in_buf);
> 
> these could be verticall aligned like
> 
> dimension = bytestream_get_be16(&in_buf);
> s->width  = bytestream_get_be16(&in_buf);
> s->height = bytestream_get_be16(&in_buf);
> s->depth  = bytestream_get_be16(&in_buf);
> 
> looks nicer ... (not really important though)

yes, I like this format :)

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGFNxA+BwsLu3sVWwRAg/pAJ9yGA7v3Cgu8ckxxL2mtUASllYnwgCeIOEN
QKgO8KkFQRmqiPpV8UM2SRc=
=9A6i
-----END PGP SIGNATURE-----





More information about the ffmpeg-devel mailing list