Summary: | Crash when displaying EXIF metadata with Unicode comment | ||
---|---|---|---|
Product: | [Applications] digikam | Reporter: | Leonid Zeitlin <lz> |
Component: | Metadata-Exif | Assignee: | Digikam Developers <digikam-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | caulier.gilles |
Priority: | NOR | ||
Version: | 0.9.0 | ||
Target Milestone: | --- | ||
Platform: | Fedora RPMs | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | 0.9.1 | |
Sentry Crash Report: | |||
Attachments: | Proposed patch to fix the crash described in this report |
Description
Leonid Zeitlin
2007-01-08 11:37:33 UTC
Created attachment 19188 [details]
Proposed patch to fix the crash described in this report
Marcel, This is another Comments encoding stuff... What do you think about the patch ? Gilles Hi Gilles, Marcel, Just curious is the patch is going to be reviewed SVN commit 626219 by mwiesweg: Apply patch from "lz@europe.com" (thanks for your help!): Append terminating "\0\0" sequence to UCS2 string properly. Adding with operator+= did nothing because it treats the sequence as a then empty C string. BUG: 139766 M +2 -2 dmetadata.cpp --- trunk/extragear/graphics/digikam/libs/dmetadata/dmetadata.cpp #626218:626219 @@ -1146,8 +1146,8 @@ if (charset == "\"Unicode\"") { // QString expects a null-terminated UCS-2 string. - // Is it already null terminated? In any case, add termination for safety. - comment += "\0\0"; + // Is it already null terminated? In any case, add termination "\0\0" for safety. + comment.resize(comment.length() + 2, '\0'); return QString::fromUcs2((unsigned short *)comment.data()); } else if (charset == "\"Jis\"") Thanks a lot! |