Skip to content

Commit

Permalink
Merge pull request #3 from sincos2854/master
Browse files Browse the repository at this point in the history
Update libpng version to 1.6.40 and fix memory allocation
  • Loading branch information
uyjulian committed Jul 4, 2023
2 parents 6ac4e43 + 837422b commit 8262ded
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ DEPENDENCY_SOURCE_FILE_ZLIB := $(DEPENDENCY_SOURCE_DIRECTORY)/zlib.tar.xz
DEPENDENCY_SOURCE_FILE_LIBPNG := $(DEPENDENCY_SOURCE_DIRECTORY)/libpng.tar.xz

DEPENDENCY_SOURCE_URL_ZLIB := https://downloads.sourceforge.net/project/libpng/zlib/1.2.11/zlib-1.2.11.tar.gz
DEPENDENCY_SOURCE_URL_LIBPNG := https://downloads.sourceforge.net/project/libpng/libpng16/1.6.39/libpng-1.6.39.tar.xz
DEPENDENCY_SOURCE_URL_LIBPNG := https://downloads.sourceforge.net/project/libpng/libpng16/1.6.40/libpng-1.6.40.tar.xz

$(DEPENDENCY_SOURCE_FILE_ZLIB): | $(DEPENDENCY_SOURCE_DIRECTORY)
curl --location --output $@ $(DEPENDENCY_SOURCE_URL_ZLIB)
Expand Down
2 changes: 1 addition & 1 deletion extractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ int GetPictureEx(size_t data_size, HANDLE *bitmap_info, HANDLE *bitmap_data,
if (getBMPFromPNG((const uint8_t *)data, data_size, &bitmap_file_header,
&bitmap_info_header, &data_u8))
return SPI_MEMORY_ERROR;
*bitmap_info = LocalAlloc(LMEM_MOVEABLE, sizeof(BITMAPINFOHEADER));
*bitmap_info = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT, sizeof(BITMAPINFO));
*bitmap_data = LocalAlloc(LMEM_MOVEABLE, bitmap_file_header.bfSize -
bitmap_file_header.bfOffBits);
if (*bitmap_info == NULL || *bitmap_data == NULL) {
Expand Down

0 comments on commit 8262ded

Please sign in to comment.