#ifndef NODEBUG
debug_printf(ALL, "kds_s2000w_convert_to_pnm_With_depth");
#endif
-
- ExceptionInfo* exception = NULL;
- Image* input_image = NULL;
- ImageInfo* image_info = NULL;
- exception = AcquireExceptionInfo();
- image_info = CloneImageInfo(NULL);
+ ExceptionInfo* exception = AcquireExceptionInfo();
+ ImageInfo* image_info = CloneImageInfo(NULL);
sprintf(image_info->filename, "streamin.%s", format);
debug_printf(DEBUG, image_info->filename);
#endif
- input_image = BlobToImage(image_info, in->data, in->size , exception);
+ Image* input_image = BlobToImage(image_info, in->data, in->size , exception);
if (exception->severity != UndefinedException) {
fprintf(stderr, "%s\n", GetExceptionMessage(exception->error_number));
out->data = ImageToBlob(image_info, input_image, &out->size, exception);
DestroyImageInfo(image_info);
+ image_info = NULL;
DestroyImage(input_image);
+ input_image = NULL;
DestroyExceptionInfo(exception);
+ exception = NULL;
}
void kds_s2000w_convert_jpg_to_pnm_with_depth(blobdata* in, blobdata* out, int depth)
debug_printf(ALL, "kds_s2000w_metadata_from_image");
#endif
- ExceptionInfo* exception = NULL;
- Image* input_image = NULL;
- ImageInfo* image_info = NULL;
-
- exception = AcquireExceptionInfo();
- image_info = CloneImageInfo(NULL);
+ ExceptionInfo* exception = AcquireExceptionInfo();
+ ImageInfo* image_info = CloneImageInfo(NULL);
sprintf(image_info->filename, "image.pnm");
- input_image = BlobToImage(image_info, image->data, image->size , exception);
+ Image* input_image = BlobToImage(image_info, image->data, image->size , exception);
if (exception->severity != UndefinedException) {
fprintf(stderr, "%s\n", GetExceptionMessage(exception->error_number));
mdata->depth = input_image->depth;
DestroyImageInfo(image_info);
+ image_info = NULL;
DestroyImage(input_image);
+ input_image = NULL;
DestroyExceptionInfo(exception);
+ exception = NULL;
}
\ No newline at end of file