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

Wolfgang Denk wd at denx.de
Mon Jun 3 13:15:59 CEST 2013


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!

> But you are right that in principle extra bytes should be allocated.

This is not a questions of "pricniple", but plainly of invoking
undefined behaviour.

Please fix.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A direct quote from the Boss: "We passed over a lot of good people to
get the ones we hired."


More information about the U-Boot mailing list