From: kramm Date: Sat, 5 Apr 2008 07:26:21 +0000 (+0000) Subject: don't close the filestream jpeg is going to read from X-Git-Tag: buttons-working~278 X-Git-Url: http://git.asbjorn.biz/?p=swftools.git;a=commitdiff_plain;h=f37e8f18c9aabe6b7298ef037df26a02bfc4f361 don't close the filestream jpeg is going to read from --- diff --git a/lib/jpeg.c b/lib/jpeg.c index d58215c..dee4dfa 100644 --- a/lib/jpeg.c +++ b/lib/jpeg.c @@ -298,12 +298,10 @@ int jpeg_load(const char*filename, unsigned char**dest, int*_width, int*_height) struct jpeg_source_mgr mgr; FILE*fi = fopen(filename, "rb"); - if(!fi) + if(!fi) { + fprintf(stderr, "Couldn't open file %s\n", filename); return 0; - fseek(fi, SEEK_END, 0); - long filesize = ftell(fi); - fseek(fi, SEEK_SET, 0); - fclose(fi); + } cinfo.err = jpeg_std_error(&jerr); jpeg_create_decompress(&cinfo);