Fri Jan 21 09:46:19 2011 UTC ()
Avoid a crash when pDrawable is null.


(ahoka)
diff -r1.1.1.2 -r1.2 xsrc/external/mit/xf86-video-intel/dist/src/i915_render.c

cvs diff -r1.1.1.2 -r1.2 xsrc/external/mit/xf86-video-intel/dist/src/Attic/i915_render.c (expand / switch to unified diff)

--- xsrc/external/mit/xf86-video-intel/dist/src/Attic/i915_render.c 2009/06/09 02:54:33 1.1.1.2
+++ xsrc/external/mit/xf86-video-intel/dist/src/Attic/i915_render.c 2011/01/21 09:46:19 1.2
@@ -159,26 +159,29 @@ static Bool i915_get_dest_format(Picture @@ -159,26 +159,29 @@ static Bool i915_get_dest_format(Picture
159 case PICT_x4r4g4b4: 159 case PICT_x4r4g4b4:
160 *dst_format = COLR_BUF_ARGB4444; 160 *dst_format = COLR_BUF_ARGB4444;
161 break; 161 break;
162 default: 162 default:
163 I830FALLBACK("Unsupported dest format 0x%x\n", 163 I830FALLBACK("Unsupported dest format 0x%x\n",
164 (int)pDstPicture->format); 164 (int)pDstPicture->format);
165 } 165 }
166 166
167 return TRUE; 167 return TRUE;
168} 168}
169 169
170static Bool i915_check_composite_texture(PicturePtr pPict, int unit) 170static Bool i915_check_composite_texture(PicturePtr pPict, int unit)
171{ 171{
 172 if (pPict->pDrawable == NULL)
 173 return FALSE;
 174
172 ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum]; 175 ScrnInfoPtr pScrn = xf86Screens[pPict->pDrawable->pScreen->myNum];
173 int w = pPict->pDrawable->width; 176 int w = pPict->pDrawable->width;
174 int h = pPict->pDrawable->height; 177 int h = pPict->pDrawable->height;
175 int i; 178 int i;
176 179
177 if ((w > 2048) || (h > 2048)) 180 if ((w > 2048) || (h > 2048))
178 I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h); 181 I830FALLBACK("Picture w/h too large (%dx%d)\n", w, h);
179 182
180 for (i = 0; i < sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]); 183 for (i = 0; i < sizeof(i915_tex_formats) / sizeof(i915_tex_formats[0]);
181 i++) 184 i++)
182 { 185 {
183 if (i915_tex_formats[i].fmt == pPict->format) 186 if (i915_tex_formats[i].fmt == pPict->format)
184 break; 187 break;