[PATCH 54/54] drm/intel: fixed unitialized variable warning and improved error handling

"Enrico Weigelt, metux IT consult" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
Signed-off-by: Enrico Weigelt, metux IT consult <[email protected]>
---
 src/drm/cairo-drm-i915-surface.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/drm/cairo-drm-i915-surface.c b/src/drm/cairo-drm-i915-surface.c
index c83e3db..ab1e997 100644
--- a/src/drm/cairo-drm-i915-surface.c
+++ b/src/drm/cairo-drm-i915-surface.c
@@ -2516,11 +2516,6 @@ i915_buffer_cache_init (intel_buffer_cache_t *cache,
     cache->buffer.height = height;
 
     switch (format) {
-    case CAIRO_FORMAT_INVALID:
-    case CAIRO_FORMAT_A1:
-    case CAIRO_FORMAT_RGB24:
-    case CAIRO_FORMAT_RGB16_565:
-	ASSERT_NOT_REACHED;
     case CAIRO_FORMAT_RGB30:
     case CAIRO_FORMAT_ARGB32:
 	cache->buffer.map0 = MAPSURF_32BIT | MT_32BIT_ARGB8888;
@@ -2530,6 +2525,12 @@ i915_buffer_cache_init (intel_buffer_cache_t *cache,
 	cache->buffer.map0 = MAPSURF_8BIT | MT_8BIT_I8;
 	stride = width;
 	break;
+    case CAIRO_FORMAT_INVALID:
+    case CAIRO_FORMAT_A1:
+    case CAIRO_FORMAT_RGB24:
+    case CAIRO_FORMAT_RGB16_565:
+    default:
+	return _cairo_error (CAIRO_STATUS_INVALID_FORMAT);
     }
     assert ((stride & 7) == 0);
     assert (i915_tiling_stride (tiling, stride) == stride);
-- 
2.6.4.442.g545299f

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.