Commits

nat_linden  committed 0366ca8 Merge

merge changes for DRTVWR-253

  • Participants
  • Parent commits ab8efc8, 32f9b25

Comments (0)

Files changed (2)

 94ab2b49458ab372a95d2d6949fdf574f413068d 3.4.3-beta1
 965b9a35e260c0f53be1a25f0db7abc8a67eaf47 DRTVWR-252
 bb10adc4f76cf0067fca7075146f00cdc0740e9d DRTVWR-251
+ab0aa2f6ba22b52fed30a2337197f589156edc75 DRTVWR-253

File indra/newview/lltexturecache.cpp

 
 		mFastCachep->seek(APR_SET, offset);		
 	
-		llassert_always(mFastCachep->read(head, TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) == TEXTURE_FAST_CACHE_ENTRY_OVERHEAD);
+		if(mFastCachep->read(head, TEXTURE_FAST_CACHE_ENTRY_OVERHEAD) != TEXTURE_FAST_CACHE_ENTRY_OVERHEAD)
+		{
+			//cache corrupted or under thread race condition
+			closeFastCache(); 
+			return NULL;
+		}
 		
 		S32 image_size = head[0] * head[1] * head[2];
 		if(!image_size) //invalid
 		discardlevel = head[3];
 		
 		data =  (U8*)ALLOCATE_MEM(LLImageBase::getPrivatePool(), image_size);
-		llassert_always(mFastCachep->read(data, image_size) == image_size);
+		if(mFastCachep->read(data, image_size) != image_size)
+		{
+			FREE_MEM(LLImageBase::getPrivatePool(), data);
+			closeFastCache();
+			return NULL;
+		}
+
 		closeFastCache();
 	}
 	LLPointer<LLImageRaw> raw = new LLImageRaw(data, head[0], head[1], head[2], true);