diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-08 16:55:31 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-02-08 16:55:31 +0300 |
commit | ec7df03c867d28316708e9b91bec5cef0aee832e (patch) | |
tree | 3f560939b745032e235d9ac789c4117d669d6462 /source/blender/imbuf/intern | |
parent | 4c318539b2f6abdf8f2a02376b6fcb8d30a4b12e (diff) |
Warning fixes, one actual bug found in sequencer sound wave drawing. Also
changed some malloc to MEM_mallocN while trying to track down a memory leak.
Diffstat (limited to 'source/blender/imbuf/intern')
-rw-r--r-- | source/blender/imbuf/intern/iff.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/thumbs.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/imbuf/intern/iff.c b/source/blender/imbuf/intern/iff.c index 5fd823e78c1..db2e54a31b6 100644 --- a/source/blender/imbuf/intern/iff.c +++ b/source/blender/imbuf/intern/iff.c @@ -198,16 +198,16 @@ unsigned short imb_update_iff(int file, int code) if (code == 0) return (TRUE); filelen-=4; - lseek(file,4L,1); + if(lseek(file,4L,1) == -1) return (FALSE); while (filelen>0){ /* seek BODY */ - read(file, buf, 8); + if(read(file, buf, 8) != 8) return (FALSE); filelen -= 8; if (buf[0] == code) break; skip = (BIG_LONG(buf[1]) + 1) & ~1; filelen -= skip; - lseek(file, skip, 1); + if(lseek(file, skip, 1) == -1) return (FALSE); } if (filelen <= 0) { printf("update_iff: couldn't find chunk\n"); diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 6053c5556f1..4e6230a0109 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -289,19 +289,19 @@ ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, Thumb } else { if (THB_SOURCE_IMAGE == source) { BLI_getwdN(wdir); - chdir(dir); + if(chdir(dir) != 0) return 0; img = IMB_loadiffname(file, IB_rect | IB_imginfo); if (img != NULL) { stat(file, &info); sprintf(mtime, "%ld", info.st_mtime); sprintf(cwidth, "%d", img->x); sprintf(cheight, "%d", img->y); - chdir(wdir); } + if(chdir(wdir) != 0) /* unlikely to happen, just silence warning */; } else if (THB_SOURCE_MOVIE == source) { struct anim * anim = NULL; BLI_getwdN(wdir); - chdir(dir); + if(chdir(dir) != 0) return 0; anim = IMB_open_anim(file, IB_rect | IB_imginfo); if (anim != NULL) { img = IMB_anim_absolute(anim, 0); @@ -315,7 +315,7 @@ ImBuf* IMB_thumb_create(const char* dir, const char* file, ThumbSize size, Thumb } stat(file, &info); sprintf(mtime, "%ld", info.st_mtime); - chdir(wdir); + if(chdir(wdir) != 0) /* unlikely to happen, just silence warning */; } if (!img) return 0; |