diff --git a/bin/openjpeg-dotnet.dll b/bin/openjpeg-dotnet.dll index 0b2d9206..1cede1c4 100644 Binary files a/bin/openjpeg-dotnet.dll and b/bin/openjpeg-dotnet.dll differ diff --git a/openjpeg-dotnet/dotnet/dotnet.cpp b/openjpeg-dotnet/dotnet/dotnet.cpp index e3c78745..25cc2ab3 100644 --- a/openjpeg-dotnet/dotnet/dotnet.cpp +++ b/openjpeg-dotnet/dotnet/dotnet.cpp @@ -94,7 +94,7 @@ bool DotNetEncode(MarshalledImage* image, bool lossless) } opj_image_t* jp2_image = opj_image_create(image->components, comptparm, CLRSPC_SRGB); - if (image == NULL) + if (jp2_image == NULL) throw "opj_image_create failed"; jp2_image->x0 = 0; @@ -144,7 +144,7 @@ bool DotNetDecode(MarshalledImage* image) opj_cio* cio = opj_cio_open((opj_common_ptr)dinfo, image->encoded, image->length); opj_image* jp2_image = opj_decode(dinfo, cio); // decode happens here - if (image == NULL) + if (jp2_image == NULL) throw "opj_decode failed"; image->width = jp2_image->x1 - jp2_image->x0; @@ -181,7 +181,7 @@ bool DotNetDecodeWithInfo(MarshalledImage* image) opj_cio* cio = opj_cio_open((opj_common_ptr)dinfo, image->encoded, image->length); opj_image* jp2_image = opj_decode_with_info(dinfo, cio, &info); // decode happens here - if (image == NULL) + if (jp2_image == NULL) throw "opj_decode failed"; // maximum number of decompositions