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 4636

Summary: Fix missing field initialization in nanosvg styles struct
Product: SDL_image Reporter: janisozaur <janisozaur+libsdl>
Component: miscAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: janisozaur+libsdl
Version: 2.0.4   
Hardware: x86_64   
OS: Linux   
Attachments: Initialize_all_the_SVG_style_fields.patch
bug-4636.svg

Description janisozaur 2019-05-19 21:22:16 UTC
Created attachment 3785 [details]
Initialize_all_the_SVG_style_fields.patch

A malformed SVG file can lead to a path where style description is left unitialized and subsequently gets passed to free() in nsvg__deleteStyles.

Attached is the patch fixing the problem and a file showcasing the problem.
Comment 1 janisozaur 2019-05-19 21:24:02 UTC
Created attachment 3786 [details]
bug-4636.svg
Comment 2 Sam Lantinga 2019-06-10 22:32:35 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL_image/rev/93332afa1831