Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ykoba:multimedia
t4k_common
t4k_loaders_bugfix.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File t4k_loaders_bugfix.patch of Package t4k_common
Description: fix loading each frame from SVG sprites rsvg_handle_get_desc returns null so next sscanf segfaults. Use instead iterating up from zero for id frame%d Author: cdonoghu@gmail.com Origin: other Forwarded: no --- This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ --- a/src/t4k_loaders.c +++ b/src/t4k_loaders.c @@ -213,14 +213,13 @@ new_sprite = malloc(sizeof(sprite)); new_sprite->default_img = render_svg_from_handle(file_handle, width, height, "#default"); - /* get number of frames from description */ - sscanf(rsvg_handle_get_desc(file_handle), "%d", &new_sprite->num_frames); - DEBUGMSG(debug_loaders, "load_svg_sprite(): loading %d frames\n", new_sprite->num_frames); - - for(i = 0; i < new_sprite->num_frames; i++) - { - sprintf(lay_name, "#frame%d", i); - new_sprite->frame[i] = render_svg_from_handle(file_handle, width, height, lay_name); + /* get number of frames directly. End when #frame<num> doesn't exist */ + new_sprite->num_frames = 0; + while(1) { + sprintf(lay_name, "#frame%d", new_sprite->num_frames); + if ( ! (rsvg_handle_has_sub(file_handle, lay_name)) ) break; + new_sprite->frame[new_sprite->num_frames] = render_svg_from_handle(file_handle, width, height, lay_name); + new_sprite->num_frames++; } g_object_unref(file_handle);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor