Bean <[EMAIL PROTECTED]> writes:
> On Jan 24, 2008 8:14 PM, Marco Gerards <[EMAIL PROTECTED]> wrote:
>> It would be nice, not required. I don't expect too much problems
>> here...
>>
>> Perhaps a better approach would be possible to do a check after
>> reading a size:
>>
>> int size = foo();
>>
>> Check the size of the file here
>>
>> while (size--)
>> {
>> read pixels;
>> }
>>
>>
> png is compressed, it's not easy to separate the pixels.
I know. With size, I meant on disk data. In many formats, compressed
data is stored like this:
struct foo
{
int width;
int height;
int on_disk_size;
char data[];
}
Some decompressors have to be initialized by this size. It's an
optimization, so zeros that follow do not have to be stored:
3A 3E AA 00 4E 00 00 00 00
on_disk_size = 5
>> Or just check for grub_errno or so after reading the picture?
>
> yes, after the picture is decoded, grub_errno is checked, if it's non
> zero, the bitmap image will be deallocated.
Ok.
(this wouldn't have worked if grub_errno was zero'ed, like it was
discussed yesterday ;-))
--
Marco
_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel