diff options
author | Dave Airlie <airliedfreedesktop.org> | 2006-03-08 05:37:58 +0000 |
---|---|---|
committer | Dave Airlie <airliedfreedesktop.org> | 2006-03-08 05:37:58 +0000 |
commit | 9fc897af7a50ec8dd9349826f97704da6d3e2411 (patch) | |
tree | d85ad41a982764b54a65ed419a2e8f0867cde0a0 /src/mesa/drivers/dri | |
parent | d97ab9a7bd407e560366843e1715b1afcd948082 (diff) |
coverity checker bug: Pointer dereferenced after NULL check
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_texmem.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_texmem.c b/src/mesa/drivers/dri/radeon/radeon_texmem.c index e2766713b2..20f25dd34b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texmem.c +++ b/src/mesa/drivers/dri/radeon/radeon_texmem.c @@ -332,7 +332,10 @@ static void uploadSubImage( radeonContextPtr rmesa, radeonTexObjPtr t, int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint face ) { - const int numLevels = t->base.lastLevel - t->base.firstLevel + 1; + int numLevels; + + if ( !t || t->base.totalSize == 0 ) + return 0; if ( RADEON_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) { fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__, @@ -340,8 +343,7 @@ int radeonUploadTexImages( radeonContextPtr rmesa, radeonTexObjPtr t, GLuint fac t->base.firstLevel, t->base.lastLevel ); } - if ( !t || t->base.totalSize == 0 ) - return 0; + numLevels = t->base.lastLevel - t->base.firstLevel + 1; if (RADEON_DEBUG & DEBUG_SYNC) { fprintf(stderr, "%s: Syncing\n", __FUNCTION__ ); |