[Spice-devel] [spice-server PATCH v1 4/12] mjpeg_encoder: fix alignment warnings (pixel_converter)

Christophe Fergeau cfergeau at redhat.com
Wed Aug 12 04:45:52 PDT 2015


On Wed, Aug 12, 2015 at 07:01:40AM -0400, Frediano Ziglio wrote:
> Not sure about it. Lines came from spice_bitmap_get_line. This
> function assume that bitmap data is split among chunks each containing
> some lines (always full lines). If chunk->data is allocated using
> malloc or similar SHOULD (not 100% sure) be 4 bytes aligned so in our
> cases (8, 16, 24 or 32 bit images) should be aligned enough.
> 
> All the casts unfortunately came from the fact we compute based on
> pixel bytes to make it generic so we use uint8_t* but clang complaints
> (well, that's why there are explicit casts, to make compiler aware we
> know we are doing the right thing).

Ah well, I mixed src_ptr and dest when taking a look ;) dest is
definitely not aligned, but only byte accesses are done on it so it does
not matter.
All of your explanation belongs in the commit log though, so that we
remember what was our reasoning at the time if this turns out to be a
problem in the future.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20150812/f8e63d4d/attachment.sig>


More information about the Spice-devel mailing list