Bug 5633 - ImageSurface.create_for_data: wrong default stride for FORMAT_RGB24
Summary: ImageSurface.create_for_data: wrong default stride for FORMAT_RGB24
Status: RESOLVED FIXED
Alias: None
Product: pycairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86 (IA32) Linux (All)
: high minor
Assignee: Steve Chaplin
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-01-17 10:42 UTC by Scott Shedden
Modified: 2006-01-19 04:59 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Scott Shedden 2006-01-17 10:42:41 UTC
If you create an ImageSurface using create_for_data with the pixel format
FORMAT_RGB24 and without specifying a stride value, the default stride is
calculated as width * 3

However, the pixel format for RGB24 is padded to 32 bits, so the default stride
should be width * 4

The obvious workaround is to specify the stride parameter explicitly.

cheers,
Scott
Comment 1 Steve Chaplin 2006-01-17 23:06:17 UTC
Fix applied to CVS.

	* cairo/pycairo-surface.c (image_surface_create_for_data): for
	CAIRO_FORMAT_RGB24 set stride = width * 4 (not 3), fixes bug #5633
Comment 2 Steve Chaplin 2006-01-19 23:59:27 UTC
Closing bug (forgot to close when added last message).


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.