From 99fe055931a2881ac9c98d4637501df6b666811a Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Tue, 25 Mar 2008 21:45:20 +0000 Subject: [PATCH] Commit patch from Jacques Boscq, which will prohibit the calling of memcpy with src=dest --- code/qcommon/files.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/qcommon/files.c b/code/qcommon/files.c index ba502220..5e001ed1 100644 --- a/code/qcommon/files.c +++ b/code/qcommon/files.c @@ -1092,8 +1092,10 @@ int FS_FOpenFileRead( const char *filename, fileHandle_t *file, qboolean uniqueF temp = zfi->file; // set the file position in the zip file (also sets the current file info) unzSetCurrentFileInfoPosition(pak->handle, pakFile->pos); - // copy the file info into the unzip structure - Com_Memcpy( zfi, pak->handle, sizeof(unz_s) ); + if ( zfi != pak->handle ) { + // copy the file info into the unzip structure + Com_Memcpy( zfi, pak->handle, sizeof(unz_s) ); + } // we copy this back into the structure zfi->file = temp; // open the file in the zip