diff options
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/targa.c | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index f248e6bb6c4..61254944001 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -279,7 +279,7 @@ struct ImBuf *IMB_loadiffname(const char *naam, int flags) { file = open(naam, O_BINARY|O_RDONLY); - if (file == -1) return (0); + if (file < 0) return (0); ibuf= IMB_loadifffile(file, flags); @@ -304,7 +304,7 @@ struct ImBuf *IMB_testiffname(char *naam,int flags) { flags |= IB_test; file = open(naam,O_BINARY|O_RDONLY); - if (file<=0) return (0); + if (file < 0) return (0); ibuf=IMB_loadifffile(file,flags); if (ibuf) { diff --git a/source/blender/imbuf/intern/targa.c b/source/blender/imbuf/intern/targa.c index c89bc6a632f..acc3e06448f 100644 --- a/source/blender/imbuf/intern/targa.c +++ b/source/blender/imbuf/intern/targa.c @@ -296,7 +296,10 @@ short imb_savetarga(struct ImBuf * ibuf, char *name, int flags) if (ibuf->cmap){ for (i = 0 ; i<ibuf->maxcol ; i++){ - if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) return (0); + if (fwrite(((uchar *)(ibuf->cmap + i)) + 1,1,3,fildes) != 3) { + fclose(fildes); + return (0); + } } } |