llvmpipe: Fix buffer overflow unswizzling several formats.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 25 Apr 2010 14:40:06 +0000 (15:40 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 25 Apr 2010 14:54:32 +0000 (15:54 +0100)
Array formats without for channels were being advanced as four channels,
causing buffer overflows.

src/gallium/drivers/llvmpipe/lp_tile_soa.py

index b2f800afd8a4c509a0238b85ef64caada77c2d51..5ab63cbac67fdc190150292e42e9967f14f349e8 100644 (file)
@@ -257,7 +257,7 @@ def emit_tile_pixel_unswizzle_code(format, src_channel):
                     value = 'TILE_PIXEL(src, x, y, %u)' % inv_swizzle[i]
                     value = conversion_expr(src_channel, dst_channel, dst_native_type, value, clamp=False)
                     print '         *dst_pixel++ = %s;' % value
-                else:
+                elif dst_channel.size:
                     print '         ++dst_pixel;'
     else:
         assert False