X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=bmp.c;h=4caefb41d41a7fb1c05a523dabd4629d16284256;hb=HEAD;hp=82b2966e61ac24e6922d54ba320b53c3cb38b637;hpb=5f9f13097a33ee622c3fc7ddc194b3212485d8b0;p=external%2Flibjpeg-turbo.git diff --git a/bmp.c b/bmp.c index 82b2966..4caefb4 100644 --- a/bmp.c +++ b/bmp.c @@ -107,6 +107,8 @@ int loadbmp(char *filename, unsigned char **buf, int *w, int *h, cjpeg_source_ptr src; FILE *file=NULL; + memset(&cinfo, 0, sizeof(struct jpeg_compress_struct)); + if(!filename || !buf || !w || !h || dstpf<0 || dstpf>=TJ_NUMPF) _throw("loadbmp(): Invalid argument"); @@ -189,6 +191,8 @@ int savebmp(char *filename, unsigned char *buf, int w, int h, int srcpf, FILE *file=NULL; char *ptr=NULL; + memset(&dinfo, 0, sizeof(struct jpeg_decompress_struct)); + if(!filename || !buf || w<1 || h<1 || srcpf<0 || srcpf>=TJ_NUMPF) _throw("savebmp(): Invalid argument");