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 /src/i965_render.c | |
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.
Diffstat (limited to 'src/i965_render.c')
-rw-r--r-- | src/i965_render.c | 3 |
1 files changed, 2 insertions, 1 deletions
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; |