Fix cogl_texture_get_data when an intermediate buffer is used
authorNeil Roberts <neil@linux.intel.com>
Thu, 8 Jul 2010 17:33:45 +0000 (18:33 +0100)
committerNeil Roberts <neil@linux.intel.com>
Fri, 9 Jul 2010 10:14:15 +0000 (11:14 +0100)
When an intermediate buffer is used for downloading texture data it
was using the wrong byte length for a row so the copy back to the
user's buffer would fail.

clutter/cogl/cogl/cogl-texture.c

index 8f2b3e2..7e80879 100644 (file)
@@ -1232,7 +1232,7 @@ cogl_texture_get_data (CoglHandle       handle,
         {
           src = new_bmp.data + y * new_bmp.rowstride;
           dst = data + y * rowstride;
-          memcpy (dst, src, new_bmp.width);
+          memcpy (dst, src, new_bmp.width * bpp);
         }
 
       /* Free converted data */