how can I get the reallocated buffer pointer

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Posts: 1
Joined: 2016-01-16T20:53:31-07:00
Authentication code: 1151

how can I get the reallocated buffer pointer

Post by Jay » 2016-01-16T21:31:30-07:00


I use imagemagick 6.7.9 C api

when i use BlobToImage(const ImageInfo *,const void * buf,const size_t,ExceptionInfo *) to convert raw image data (PSD) to image object, i found that this function will reallocate my image buf (use realloc()).

Actually, BlobToImage() will call ReadImage(), then ReadImage() call ReadPSDImage(), and then ReadPSDImage() wiil call SeekBlob(), the image buf is reallocated in SeekBlob(). The new buf pointer is assigned to image->blob->data, but ReadPSDImage() will call CloseBlob() finally which set image->blob->data to null.

My problem is, how can i get the reallocated buf pointer?

Please help me~ thx~

Post Reply