Skip to content

Commit

Permalink
Fix incorrect client_data pointer being set in libjpeg context. (#152)
Browse files Browse the repository at this point in the history
This fixes incorrect data processing in libjpeg callbacks.

Fixes #150
Fixes #151
  • Loading branch information
Lastique authored Apr 29, 2021
1 parent 370ce4c commit bcbfef9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coders/jpeg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ static Image *ReadJPEGImage_(const ImageInfo *image_info,
InheritException(exception,&image->exception);
return(DestroyImage(image));
}
jpeg_info->client_data=(void *) &client_info;
jpeg_info->client_data=(void *) client_info;
jpeg_create_decompress(jpeg_info);
if (GetMaxMemoryRequest() != ~0UL)
jpeg_info->mem->max_memory_to_use=(long) GetMaxMemoryRequest();
Expand Down Expand Up @@ -2361,7 +2361,7 @@ static MagickBooleanType WriteJPEGImage_(const ImageInfo *image_info,
(void) CloseBlob(volatile_image);
return(MagickFalse);
}
jpeg_info->client_data=(void *) &client_info;
jpeg_info->client_data=(void *) client_info;
jpeg_create_compress(jpeg_info);
JPEGDestinationManager(jpeg_info,image);
if ((image->columns != (unsigned int) image->columns) ||
Expand Down

0 comments on commit bcbfef9

Please sign in to comment.