Make sure we don't call jpeg_destroy_[de]compress() on an uninitialized struct, as bad mojo can ensue.


git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@714 632fc199-4ca6-4c93-a231-07263d6284db
diff --git a/bmp.c b/bmp.c
index 82b2966..4caefb4 100644
--- a/bmp.c
+++ b/bmp.c
@@ -107,6 +107,8 @@
 	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 @@
 	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");