-
-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
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
Win32 build #25
Win32 build #25
Conversation
@@ -19,7 +19,6 @@ | |||
*/ | |||
|
|||
#include <assert.h> | |||
#include <alloca.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to include stdlib.h
now for malloc
/free
(see error in Travis)..
src/file-fuzzer.cc
Outdated
@@ -103,5 +102,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) { | |||
|
|||
quit: | |||
heif_context_free(ctx); | |||
free (image_IDs); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No whitespace between function name and parameters.
src/heif_image.cc
Outdated
@@ -896,7 +896,8 @@ Error HeifPixelImage::fill_RGB_16bit(uint16_t r, uint16_t g, uint16_t b, uint16_ | |||
int stride = plane.stride; | |||
uint8_t* data = plane.mem.data(); | |||
|
|||
uint16_t val16; | |||
// initialization only to avoid a warning of uninitalized variable. | |||
uint16_t val16 = r; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please set to 0
in the default
case below before the assert
instead.
Btw, which compiler are you using? We are testing with AppVeyor where building with Visual Studio 14 2015 succeeds. |
Use malloc() instead of alloca() and properly free the allocated memory. Fixes build error: > fatal error: alloca.h: No such file or directory
Actually the only code path where val16 may be uninitialized would end up in assert(), so that's impossible. But that still broke gcc cross-compilation here, even more since all warnings are treated as errors. So let's just initialize the variable to something. Fixes: > error: 'val16' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Sorry for the style bugs. We are the first to ask of contributors to follow our style guidelines. I should have been more careful. ;-)
I cross-build from Linux with mingw-w64. |
Hmm, we should cover that with Travis then 😄 PR looks good now, thanks! I'll merge when CI is green. |
For GIMP, we need libheif to build for Windows. Here are the commits which resulted after failing to build (now it builds fine).