state_tracker: fix dereference before null check

Coverity error
CID 1528178 (#1 of 1): Dereference before null check (REVERSE_INULL)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Illia Polishchuk <illia.a.polishchuk@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20893>
This commit is contained in:
Illia Polishchuk 2023-05-08 04:36:10 +03:00 committed by Marge Bot
parent 34e47b40e6
commit c1a02c0138

View file

@ -2081,7 +2081,7 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
GLubyte *map;
unsigned dstz = texImage->Face + texImage->TexObject->Attrib.MinLayer;
unsigned dst_level = 0;
bool is_ms = dst->nr_samples > 1;
bool is_ms;
bool throttled = false;
st_flush_bitmap_cache(st);
@ -2097,6 +2097,8 @@ st_TexSubImage(struct gl_context *ctx, GLuint dims,
if (!dst)
goto fallback;
is_ms = dst->nr_samples > 1;
/* Try texture_subdata, which should be the fastest memcpy path. */
if (pixels &&
!unpack->BufferObj &&