| From 180cac2e0793b2aee9a724678f730419d7817e3c Mon Sep 17 00:00:00 2001 |
| From: James Ausmus <james.ausmus@intel.com> |
| Date: Mon, 4 May 2015 15:06:06 -0700 |
| Subject: [PATCH 13/24] CHROMIUM: swrast: Don't crash when there are no render slices |
| |
| It is legal not to have slices (for example with a 0x0 texture) |
| so we should handle that case. |
| |
| BUG=chrome-os-partner:21569 |
| TEST=by hand on falco, see bug |
| |
| Signed-off-by: Prince Agyeman <prince.agyeman@intel.com> |
| Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> |
| Signed-off-by: James Ausmus <james.ausmus@intel.com> |
| Signed-off-by: Tomasz Figa <tfiga@chromium.org> |
| --- |
| src/mesa/swrast/s_texrender.c | 5 ++++- |
| 1 file changed, 4 insertions(+), 1 deletion(-) |
| |
| diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c |
| index 4e41b3b72a88..ff90bad6256c 100644 |
| --- a/src/mesa/swrast/s_texrender.c |
| +++ b/src/mesa/swrast/s_texrender.c |
| @@ -52,7 +52,10 @@ update_wrapper(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) |
| /* Want to store linear values, not sRGB */ |
| rb->Format = _mesa_get_srgb_format_linear(format); |
| |
| - srb->Buffer = swImage->ImageSlices[zOffset]; |
| + if (swImage->ImageSlices) |
| + srb->Buffer = swImage->ImageSlices[zOffset]; |
| + else |
| + srb->Buffer = NULL; |
| } |
| |
| |
| -- |
| 2.5.1 |
| |