diff options
-rw-r--r-- | src/radeon_accel.c | 4 | ||||
-rw-r--r-- | src/radeon_render.c | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/radeon_accel.c b/src/radeon_accel.c index 028f2727..ac422571 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -712,6 +712,10 @@ RADEONHostDataBlitCopyPass( unsigned int dstPitch, unsigned int srcPitch ){ + + /* RADEONHostDataBlitCopy can return NULL ! */ + if( (dst==NULL) || (src==NULL)) return; + if ( dstPitch == srcPitch ) { memcpy( dst, src, hpass * dstPitch ); diff --git a/src/radeon_render.c b/src/radeon_render.c index 29ef966e..e5715fb0 100644 --- a/src/radeon_render.c +++ b/src/radeon_render.c @@ -425,6 +425,7 @@ static Bool FUNC_NAME(R100SetupTexture)( #ifdef ACCEL_CP CARD32 buf_pitch; unsigned int hpass; + CARD8 *tmp_dst; #endif ACCEL_PREAMBLE(); @@ -469,10 +470,10 @@ static Bool FUNC_NAME(R100SetupTexture)( while ( height ) { - RADEONHostDataBlitCopyPass( RADEONHostDataBlit( pScrn, tex_bytepp, width, + tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width, dst_pitch, &buf_pitch, - &dst, &height, &hpass ), - src, hpass, buf_pitch, src_pitch ); + &dst, &height, &hpass ); + RADEONHostDataBlitCopyPass( tmp_dst, src, hpass, buf_pitch, src_pitch ); src += hpass * src_pitch; } @@ -743,6 +744,7 @@ static Bool FUNC_NAME(R200SetupTexture)( #ifdef ACCEL_CP CARD32 buf_pitch; unsigned int hpass; + CARD8 *tmp_dst; #endif ACCEL_PREAMBLE(); @@ -787,10 +789,10 @@ static Bool FUNC_NAME(R200SetupTexture)( while ( height ) { - RADEONHostDataBlitCopyPass( RADEONHostDataBlit( pScrn, tex_bytepp, width, + tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width, dst_pitch, &buf_pitch, - &dst, &height, &hpass ), - src, hpass, buf_pitch, src_pitch ); + &dst, &height, &hpass ); + RADEONHostDataBlitCopyPass( tmp_dst, src, hpass, buf_pitch, src_pitch ); src += hpass * src_pitch; } |