ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/rv2.c
(Generate patch)

Comparing ray/src/rt/rv2.c (file contents):
Revision 1.26 by greg, Mon Aug 26 10:12:02 1991 UTC vs.
Revision 1.27 by greg, Mon Aug 26 12:53:21 1991 UTC

# Line 574 | Line 574 | char  *s;
574          fputresolu(YMAJOR|YDECR, hresolu, vresolu, fp);
575  
576          scanline = (COLR *)malloc(hresolu*sizeof(COLR));
577 <        if (scanline == NULL)
578 <                error(SYSTEM, "out of memory in writepict");
577 >        if (scanline == NULL) {
578 >                error(COMMAND, "not enough memory!");
579 >                fclose(fp);
580 >                unlink(fname);
581 >                return;
582 >        }
583          for (y = vresolu-1; y >= 0; y--) {
584                  getpictcolrs(y, scanline, &ptrunk, hresolu, vresolu);
585                  if (fwritecolrs(scanline, hresolu, fp) < 0)
586                          break;
587          }
588 +        free((char *)scanline);
589          if (fclose(fp) < 0)
590                  error(COMMAND, "write error");
586        free((char *)scanline);
591   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines