From: Rudolf Polzer Date: Mon, 7 May 2012 10:32:21 +0000 (+0200) Subject: Merge remote-tracking branch 'ttimo/master' X-Git-Tag: xonotic-v0.7.0~16^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7fc621fc78d0e040dc2c12f38dc53dd9048215dc;p=xonotic%2Fnetradiant.git Merge remote-tracking branch 'ttimo/master' Conflicts: config.py libs/missing.h plugins/model/cpicosurface.cpp plugins/vfspk3/unzip.cpp radiant/main.cpp radiant/mainframe.cpp radiant/mainframe.h radiant/missing.cpp radiant/pluginmanager.cpp radiant/preferences.cpp radiant/preferences.h tools/quake3/common/cmdlib.c tools/quake3/common/unzip.c tools/quake3/q3map2/image.c --- 7fc621fc78d0e040dc2c12f38dc53dd9048215dc diff --cc tools/quake3/common/unzip.c index c35755ac,61598d71..07107497 --- a/tools/quake3/common/unzip.c +++ b/tools/quake3/common/unzip.c @@@ -1239,20 -1257,19 +1257,21 @@@ static int unzlocal_getByte(FILE *fin,i else return UNZ_EOF; } - } - */ + } + */ /* =========================================================================== - Reads a long in LSB order from the given gz_stream. Sets - */ - static int unzlocal_getShort( FILE* fin, uLong *pX ){ - short v; + Reads a long in LSB order from the given gz_stream. Sets + */ + static int unzlocal_getShort (FILE* fin, uLong *pX) + { + short v; - fread( &v, sizeof(v), 1, fin ); + if ( fread( &v, sizeof( v ), 1, fin ) != 1 ) { + return UNZ_EOF; + } - *pX = __LittleShort( v ); + *pX = __LittleShort( v); return UNZ_OK; /* @@@ -1266,23 -1283,22 +1285,24 @@@ if (err==UNZ_OK) err = unzlocal_getByte(fin,&i); x += ((uLong)i)<<8; - + if (err==UNZ_OK) - *pX = x; + *pX = x; else - *pX = 0; + *pX = 0; return err; - */ + */ } - static int unzlocal_getLong( FILE *fin, uLong *pX ){ - int v; + static int unzlocal_getLong (FILE *fin, uLong *pX) + { + int v; - fread( &v, sizeof(v), 1, fin ); + if ( fread( &v, sizeof( v ), 1, fin ) != 1 ) { + return UNZ_EOF; + } - *pX = __LittleLong( v ); + *pX = __LittleLong( v); return UNZ_OK; /* diff --cc tools/quake3/q3map2/image.c index 8ac3c6ce,2af46a6f..5ab1d48b --- a/tools/quake3/q3map2/image.c +++ b/tools/quake3/q3map2/image.c @@@ -97,9 -97,8 +97,8 @@@ static void LoadDDSBuffer( byte *buffer typedef struct pngBuffer_s { byte *buffer; - int size, offset; + png_size_t size, offset; - } - pngBuffer_t; + } pngBuffer_t; void PNGReadData( png_struct *png, png_byte *buffer, png_size_t size ){ pngBuffer_t *pb = (pngBuffer_t*) png_get_io_ptr( png );