diff options
author | Kristian Høgsberg <krh@redhat.com> | 2008-03-11 13:48:07 -0400 |
---|---|---|
committer | Kristian Høgsberg <krh@redhat.com> | 2008-03-11 13:48:07 -0400 |
commit | 9fd13e6773371c82b9799a5bda7c96ffa5cafe8c (patch) | |
tree | b1a4adc1208ad34415b4615b74f3f73729fbd1e6 | |
parent | 02c0ffb1d8112a6fb03f9c8eae9ec1a1fca123ef (diff) |
Silence warnings about possible uninitialize use of dst_format.
Whoa, gcc got a lot smarter about warnings. If iXXX_get_dest_format()
doesn't support the picture format passed in it won't initialize the
uint32_t pointed to by dst_format and return FALSE.
What gcc now can detect is if dst_format is used without checking the
return value, it might be used uninitialized. This patch makes sure
we always check the return value before using dst_format.
-rw-r--r-- | src/i830_render.c | 3 | ||||
-rw-r--r-- | src/i915_render.c | 3 | ||||
-rw-r--r-- | src/i965_render.c | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/src/i830_render.c b/src/i830_render.c index 22e09c84..ed44b368 100644 --- a/src/i830_render.c +++ b/src/i830_render.c @@ -403,7 +403,8 @@ i830_prepare_composite(int op, PicturePtr pSrcPicture, IntelEmitInvarientState(pScrn); *pI830->last_3d = LAST_3D_RENDER; - i830_get_dest_format(pDstPicture, &dst_format); + if (!i830_get_dest_format(pDstPicture, &dst_format)) + return FALSE; dst_offset = intel_get_pixmap_offset(pDst); dst_pitch = intel_get_pixmap_pitch(pDst); diff --git a/src/i915_render.c b/src/i915_render.c index ca85bf73..0142f5e5 100644 --- a/src/i915_render.c +++ b/src/i915_render.c @@ -322,7 +322,8 @@ i915_prepare_composite(int op, PicturePtr pSrcPicture, IntelEmitInvarientState(pScrn); *pI830->last_3d = LAST_3D_RENDER; - i915_get_dest_format(pDstPicture, &dst_format); + if (!i915_get_dest_format(pDstPicture, &dst_format)) + return FALSE; dst_offset = intel_get_pixmap_offset(pDst); dst_pitch = intel_get_pixmap_pitch(pDst); FS_LOCALS(20); diff --git a/src/i965_render.c b/src/i965_render.c index 4b1d7f3e..a749301c 100644 --- a/src/i965_render.c +++ b/src/i965_render.c @@ -629,7 +629,8 @@ i965_prepare_composite(int op, PicturePtr pSrcPicture, memset(dest_surf_state, 0, sizeof(*dest_surf_state)); dest_surf_state->ss0.surface_type = BRW_SURFACE_2D; dest_surf_state->ss0.data_return_format = BRW_SURFACERETURNFORMAT_FLOAT32; - i965_get_dest_format(pDstPicture, &dst_format); + if (!i965_get_dest_format(pDstPicture, &dst_format)) + return FALSE; dest_surf_state->ss0.surface_format = dst_format; dest_surf_state->ss0.writedisable_alpha = 0; |