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 - Windows Imaging Component backend for SDL_image
Summary: Windows Imaging Component backend for SDL_image
Status: RESOLVED FIXED
Alias: None
Product: SDL_image
Classification: Unclassified
Component: misc (show other bugs)
Version: 2.0.0
Hardware: All Windows (All)
: P2 enhancement
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-30 12:06 UTC by Alexey
Modified: 2017-09-12 07:46 UTC (History)
1 user (show)

See Also:


Attachments
patch (10.95 KB, text/plain)
2014-12-30 12:06 UTC, Alexey
Details
modified patch (11.08 KB, text/plain)
2015-01-04 01:53 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
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