[U-Boot] [PATCH] lcd: align bmp header when uncopmressing image

Piotr Wilczek p.wilczek at samsung.com
Mon Jun 3 16:14:48 CEST 2013


Dear Wolfgang Denk,

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de]
> Sent: Monday, June 03, 2013 1:16 PM
> To: Piotr Wilczek
> Cc: u-boot at lists.denx.de; 'Minkyu Kang'; 'Kyungmin Park'; Lukasz
> Majewski; 'Anatolij Gustschin'
> Subject: Re: [PATCH] lcd: align bmp header when uncopmressing image
> 
> Dear Piotr Wilczek,
> 
> In message <000601ce6021$fcb8f490$f62addb0$%wilczek at samsung.com> you
> wrote:
> >
> > > If you do this, you must also account for the up to 2 additional
> > > bytes needed in the allocated buffer.
> > >
> > > Otherwise you might write over the end of the buffer...
> > >
> > Because 8-byte alignment is guaranteed by malloc I don't think might
> > over write anything when moving by only 2 bytes.
> 
> Oops??? Initial alignment has NOTHING to do with writing over the
> allocated end of memory!
> 
No, I meant only that malloc allocates memory in at least 4-byte resolution.
I surely should have allocated extra memory for the aligned header in the first patch.

Please see my fixed patch.

Best regards,
Piotr Wilczek




More information about the U-Boot mailing list