Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Evergreen:11.1
libgphoto2
fix-delete.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File fix-delete.patch of Package libgphoto2
--- camlibs/ptp2/library.c +++ camlibs/ptp2/library.c @@ -3561,19 +3561,6 @@ CPR (context, ptp_deleteobject(params, params->handles.Handler[object_id],0)); - /* Remove it from the internal structures. */ - if (object_id < params->handles.n) { /* if not last ... */ - memcpy (params->handles.Handler+object_id, - params->handles.Handler+object_id+1, - (params->handles.n-object_id-1)*sizeof(params->handles.Handler[0]) - ); - memcpy (params->objectinfo+object_id, - params->objectinfo+object_id+1, - (params->handles.n-object_id-1)*sizeof(params->objectinfo[0]) - ); - } - params->handles.n--; - /* On some Canon firmwares, a DeleteObject causes a ObjectRemoved event * to be sent. At least on Digital IXUS II and PowerShot A85. But * not on 350D. @@ -3618,17 +3605,6 @@ return (GP_ERROR_BAD_PARAMETERS); CPR (context, ptp_deleteobject(params, params->handles.Handler[object_id],0)); - - /* Remove it from the internal structures. */ - memcpy (params->handles.Handler+object_id, - params->handles.Handler+object_id+1, - (params->handles.n-object_id-1)*sizeof(params->handles.Handler[0]) - ); - memcpy (params->objectinfo+object_id, - params->objectinfo+object_id+1, - (params->handles.n-object_id-1)*sizeof(params->objectinfo[0]) - ); - params->handles.n--; return (GP_OK); } --- camlibs/ptp2/ptp.c +++ camlibs/ptp2/ptp.c @@ -4296,10 +4296,12 @@ for (i = 0; i < params->handles.n; i++) { if (params->handles.Handler[i] == handle) { ptp_free_objectinfo(¶ms->objectinfo[i]); - memmove(params->handles.Handler+i, params->handles.Handler+i+1, - (params->handles.n-i-1)*sizeof(uint32_t)); - memmove(params->objectinfo+i, params->objectinfo+i+1, - (params->handles.n-i-1)*sizeof(PTPObjectInfo)); + if (i < params->handles.n-1) { + memmove(params->handles.Handler+i, params->handles.Handler+i+1, + (params->handles.n-i-1)*sizeof(uint32_t)); + memmove(params->objectinfo+i, params->objectinfo+i+1, + (params->handles.n-i-1)*sizeof(PTPObjectInfo)); + } params->handles.n--; /* We use less memory than before so this shouldn't fail */ params->handles.Handler = realloc(params->handles.Handler, sizeof(uint32_t)*params->handles.n);
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