[brlcad-commits] SF.net SVN: brlcad:[48333] brlcad/trunk/src/liboptical/photonmap.c
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <eri...@us...> - 2012-01-10 19:53:00
|
Revision: 48333 http://brlcad.svn.sourceforge.net/brlcad/?rev=48333&view=rev Author: erikgreenwald Date: 2012-01-10 19:52:54 +0000 (Tue, 10 Jan 2012) Log Message: ----------- verify irradiance cache info on read. Cov1483 Modified Paths: -------------- brlcad/trunk/src/liboptical/photonmap.c Modified: brlcad/trunk/src/liboptical/photonmap.c =================================================================== --- brlcad/trunk/src/liboptical/photonmap.c 2012-01-10 19:49:46 UTC (rev 48332) +++ brlcad/trunk/src/liboptical/photonmap.c 2012-01-10 19:52:54 UTC (rev 48333) @@ -1168,7 +1168,7 @@ { size_t ret; FILE *FH; - int I1, i; + int I1 = 0, i; short S1; char C1; @@ -1214,7 +1214,7 @@ bu_log("Error reading irradiance cache file (C1)\n"); ret = fread(&I1, sizeof(int), 1, FH); - if (ret != 1) + if (ret != 1 || I1 < 0) bu_log("Error reading irradiance cache file (l1)\n"); Initialize(PM_CAUSTIC, I1); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |