grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] PNG image reader


From: Bean
Subject: Re: [PATCH] PNG image reader
Date: Thu, 24 Jan 2008 20:02:26 +0800

On Jan 24, 2008 4:29 PM, Marco Gerards <address@hidden> wrote:
> Bean <address@hidden> writes:
>
> > On Jan 23, 2008 6:36 PM, Marco Gerards <address@hidden> wrote:
> >> > static grub_uint32_t
> >> > grub_png_get_dword (struct grub_png_data *data)
> >> > {
> >> >   grub_uint32_t r;
> >> >
> >> >   r = 0;
> >>
> >> Why this?
> >
> > just to make sure if grub_file_read fails, this function will return 0.
>
> It would better to do proper error handling.  This error is never
> picked up...  How about:
>
> static grub_err_t
> grub_png_get_dword (struct grub_png_data *data,  grub_uint32_t *val)
>
>

because grub_png_get_byte and grub_png_get_dword appear in many
places, checking every call is not efficient. i have added test in
critical place to ensure error will be caught. however, if you think
strict checking is necessary, i can make the change.


-- 
Bean




reply via email to

[Prev in Thread] Current Thread [Next in Thread]