OSDN Git Service

st/mesa: copy num_immediates field when copying the immediates array
authorBrian Paul <brianp@vmware.com>
Thu, 19 Jan 2012 17:20:24 +0000 (10:20 -0700)
committerBrian Paul <brianp@vmware.com>
Thu, 19 Jan 2012 22:12:14 +0000 (15:12 -0700)
commitfdae0eaf222f271bfbc7e71d8561eb8b90685ae5
tree3b74171540e69aa6fe4135bbc25d7991b704e8ae
parentf0ea46790f8f4df9a39b0cfab5c5f1bf02c136fc
st/mesa: copy num_immediates field when copying the immediates array

Two assignments to num_immediates were missing in
get_pixel_transfer_visitor() and get_bitmap_visitor().
The uninitialized value led to valgrind errors and crashes in some
cases.

Added new assertions to catch future problems in this area.  Also
changed num_immediates to unsigned to avoid signed/unsigned
comparison warnings.

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
src/mesa/state_tracker/st_glsl_to_tgsi.cpp