subpicture: don't overallocate palette on 64-bit systems.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 3 Jan 2013 14:57:25 +0000 (15:57 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 3 Jan 2013 15:04:35 +0000 (16:04 +0100)
Allocate the exact amount of memory for VA image palettes on 64-bit
systems. No more.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
src/i965_drv_video.c

index 5051f31..1dbbcbb 100755 (executable)
@@ -2392,7 +2392,7 @@ i965_CreateImage(VADriverContextP ctx,
     dri_bo_reference(obj_image->bo);
 
     if (image->num_palette_entries > 0 && image->entry_bytes > 0) {
-        obj_image->palette = malloc(image->num_palette_entries * sizeof(obj_image->palette));
+        obj_image->palette = malloc(image->num_palette_entries * sizeof(*obj_image->palette));
         if (!obj_image->palette)
             goto error;
     }