vc1: fix bitplane buffer size (SNB, IVB).
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 2 Feb 2012 13:42:11 +0000 (14:42 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 23 Feb 2012 09:12:16 +0000 (10:12 +0100)
This fixes buffer overflow in the newly allocated Gen buffer that holds
VC-1 bitplanes.

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

diff --git a/NEWS b/NEWS
index 8c5ac97..806ad43 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ libva-driver-intel NEWS -- summary of changes.  2012-02-DD
 Copyright (C) 2009-2011 Intel Corporation
 
 Version 1.0.16 - DD.Feb.2012
+* Fix VC-1 bitplane buffer size (SNB, IVB)
 * Fix VC-1 motion vector modes for Ivy Bridge
 * Fix MFX_QM_STATE for H.264 flat scaling lists (IVB)
 * Fix and simplify AVC_REF_IDX_STATE setup (ILK, SNB, IVB)
index 8280771..c87a65f 100644 (file)
@@ -1502,7 +1502,7 @@ gen6_mfd_vc1_decode_init(VADriverContextP ctx,
 
         bo = dri_bo_alloc(i965->intel.bufmgr,
                           "VC-1 Bitplane",
-                          bitplane_width * bitplane_width,
+                          bitplane_width * height_in_mbs,
                           0x1000);
         assert(bo);
         gen6_mfd_context->bitplane_read_buffer.bo = bo;
index 02047c1..7b89e1c 100644 (file)
@@ -1469,7 +1469,7 @@ gen7_mfd_vc1_decode_init(VADriverContextP ctx,
 
         bo = dri_bo_alloc(i965->intel.bufmgr,
                           "VC-1 Bitplane",
-                          bitplane_width * bitplane_width,
+                          bitplane_width * height_in_mbs,
                           0x1000);
         assert(bo);
         gen7_mfd_context->bitplane_read_buffer.bo = bo;