Skip to content

Commit

Permalink
Merge pull request #8 from sincos2854/master
Browse files Browse the repository at this point in the history
Update libavif version to 0.11.1 and fix memory allocation
  • Loading branch information
uyjulian authored Jul 5, 2023
2 parents a447dde + f33bf02 commit 846ceec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ DEPENDENCY_SOURCE_FILE_DAV1D := $(DEPENDENCY_SOURCE_DIRECTORY)/dav1d.tar.bz2
DEPENDENCY_SOURCE_FILE_LIBAVIF := $(DEPENDENCY_SOURCE_DIRECTORY)/libavif.tar.gz

DEPENDENCY_SOURCE_URL_DAV1D := https://code.videolan.org/videolan/dav1d/-/archive/1.0.0/dav1d-1.0.0.tar.bz2
DEPENDENCY_SOURCE_URL_LIBAVIF := https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.11.0.tar.gz
DEPENDENCY_SOURCE_URL_LIBAVIF := https://github.com/AOMediaCodec/libavif/archive/refs/tags/v0.11.1.tar.gz

$(DEPENDENCY_SOURCE_FILE_DAV1D): | $(DEPENDENCY_SOURCE_DIRECTORY)
curl --location --output $@ $(DEPENDENCY_SOURCE_URL_DAV1D)
Expand Down
18 changes: 1 addition & 17 deletions extractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,27 +88,11 @@ int getBMPFromAVIF(const uint8_t *input_data, size_t file_size,
curbit_2[i] = tmp;
}
}
#if 0
for (int j = 0; j < height; j++) {
uint8_t *curbit = bitmap_data + (height - (1 + j)) * bit_length;
for (int i = 0; i < width; i++) {
curbit[0] =
rgb.pixels[i + (j * rgb.rowBytes) + 2]; // B
curbit[1] =
rgb.pixels[i + (j * rgb.rowBytes) + 1]; // G
curbit[2] =
rgb.pixels[i + (j * rgb.rowBytes) + 0]; // R
curbit[3] =
rgb.pixels[i + (j * rgb.rowBytes) + 3]; // A
curbit += 4;
}
}
#endif
} else {
goto cleanup;
}

*h_bitmap_info = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT, sizeof(BITMAPINFOHEADER));
*h_bitmap_info = LocalAlloc(LMEM_MOVEABLE | LMEM_ZEROINIT, sizeof(BITMAPINFO));
if (NULL == *h_bitmap_info)
{
goto cleanup;
Expand Down

0 comments on commit 846ceec

Please sign in to comment.