We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2829

Summary: Windows Imaging Component backend for SDL_image
Product: SDL_image Reporter: Alexey <alexey.petruchik>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: philipp.wiesemann
Version: 2.0.0   
Hardware: All   
OS: Windows (All)   
Attachments: patch
modified patch

Description Alexey 2014-12-30 12:06:28 UTC
Created attachment 1980 [details]
patch

Windows Imaging Component backend for SDL2_image. Just like ImageIO\UIImage for OS X. Can load PNG\JPG\TIF. Patch was made for revision 2b0ada991468.
Backend can be enabled by SDL_IMAGE_USE_WIC_BACKEND define.
Comment 1 Philipp Wiesemann 2014-12-31 20:39:21 UTC
Thank you for providing a patch.

In WIC_LoadImage() the return value of SDL_malloc() is not checked for being not NULL. It can be null if there is not enough memory is available. This could lead to a crash later (apart from not loading the image anyway :).

There is no need to check the variable memoryBuffer before SDL_free(). It accepts NULL pointers.
Comment 2 Alexey 2015-01-04 01:53:56 UTC
Created attachment 1982 [details]
modified patch
Comment 3 Alexey 2015-01-04 01:54:46 UTC
I've uploaded modified path with fixes to mentioned issues.
Comment 4 Alexey 2015-01-11 17:11:12 UTC
Is there anything else preventing from merging this patch to upstream?
Comment 5 Alexey 2015-03-16 23:14:29 UTC
It would be really great to see this patch finally merged.
Comment 6 Sam Lantinga 2017-09-12 07:46:04 UTC
Added, thanks!
https://hg.libsdl.org/SDL_image/rev/97006d0351fe