Bug 5633

Summary: ImageSurface.create_for_data: wrong default stride for FORMAT_RGB24
Product: pycairo Reporter: Scott Shedden <scott.shedden>
Component: generalAssignee: Steve Chaplin <d74n5pohf9>
Status: RESOLVED FIXED QA Contact:
Severity: minor    
Priority: high    
Version: unspecified   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

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.