We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think dmtxEncodeDataMatrix should free the image->pxl buffer if the DmtxEncode struct is re-used, e.g.:
dmtxEncodeDataMatrix
image->pxl
DmtxEncode
unsigned char str[] = "30Q324343430794<OQQ"; DmtxEncode *enc; enc = dmtxEncodeCreate(); dmtxEncodeDataMatrix(enc, strlen(str), str); dmtxEncodeDataMatrix(enc, strlen(str), str); dmtxEncodeDestroy(&enc);
Here the image from the first call gets overwritten: https://github.com/dmtx/libdmtx/blob/master/dmtxencode.c#L222
image
The call to dmtxEncodeDestroy only deletes the second pixel buffer in my example above, see: https://github.com/dmtx/libdmtx/blob/master/dmtxencode.c#L70
dmtxEncodeDestroy
I'd suggest to call dmtxImageDestroy and freeing the pixel buffer in the dmtxEncodeDataMatrix function if an image is present from a previous call.
dmtxImageDestroy
free
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I think
dmtxEncodeDataMatrix
should free theimage->pxl
buffer if theDmtxEncode
struct is re-used, e.g.:Here the
image
from the first call gets overwritten: https://github.com/dmtx/libdmtx/blob/master/dmtxencode.c#L222The call to
dmtxEncodeDestroy
only deletes the second pixel buffer in my example above, see: https://github.com/dmtx/libdmtx/blob/master/dmtxencode.c#L70I'd suggest to call
dmtxImageDestroy
andfree
ing the pixel buffer in thedmtxEncodeDataMatrix
function if animage
is present from a previous call.The text was updated successfully, but these errors were encountered: