Skip to content

Commit

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

Fixes ImageMagick#150
Fixes ImageMagick#151
  • Loading branch information
Lastique committed Apr 27, 2021
1 parent 99cbc9f commit 3db436f
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 @@ -1198,7 +1198,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 @@ -2360,7 +2360,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 3db436f

Please sign in to comment.