~ubuntu-branches/ubuntu/precise/mesa/precise-security

« back to all changes in this revision

Viewing changes to src/mesa/drivers/dri/intel/intel_mipmap_tree.c

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers, Steve Beattie
  • Date: 2012-10-19 09:04:04 UTC
  • mfrom: (163.1.4 precise-proposed)
  • Revision ID: package-import@ubuntu.com-20121019090404-5zbjpsp6knv7zl3b
Tags: 8.0.4-0ubuntu0.2
[ Steve Beattie ]
* SECURITY UPDATE: samplers array overflow (LP: #1046933)
  - debian/patches/50-CVE-2012-2864.patch: ensure that more than
    MAX_SAMPLERS are not used
  - CVE-2012-2864

Show diffs side-by-side

added added

removed removed

Lines of Context:
702
702
   y /= bh;
703
703
 
704
704
   base = intel_region_map(intel, mt->region, map->mode);
705
 
   /* Note that in the case of cube maps, the caller must have passed the slice
706
 
    * number referencing the face.
707
 
    */
708
 
   intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
709
 
   x += image_x;
710
 
   y += image_y;
711
 
 
712
 
   map->stride = mt->region->pitch * mt->cpp;
713
 
   map->ptr = base + y * map->stride + x * mt->cpp;
 
705
 
 
706
   if (base == NULL)
 
707
      map->ptr = NULL;
 
708
   else {
 
709
      /* Note that in the case of cube maps, the caller must have passed the
 
710
       * slice number referencing the face.
 
711
      */
 
712
      intel_miptree_get_image_offset(mt, level, 0, slice, &image_x, &image_y);
 
713
      x += image_x;
 
714
      y += image_y;
 
715
 
 
716
      map->stride = mt->region->pitch * mt->cpp;
 
717
      map->ptr = base + y * map->stride + x * mt->cpp;
 
718
   }
714
719
 
715
720
   DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__,
716
721
       map->x, map->y, map->w, map->h,
1067
1072
 
1068
1073
   *out_ptr = map->ptr;
1069
1074
   *out_stride = map->stride;
 
1075
 
 
1076
   if (map->ptr == NULL) {
 
1077
      mt->level[level].slice[slice].map = NULL;
 
1078
      free(map);
 
1079
   }
1070
1080
}
1071
1081
 
1072
1082
void