Merge branch 'master' into pixelshift

This commit is contained in:
heckflosse
2017-01-20 21:13:50 +01:00
102 changed files with 4149 additions and 3327 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -445,11 +445,16 @@ public:
UserCommentInterpreter () {}
virtual std::string toString (Tag* t)
{
char *buffer = new char[t->getCount()];
int count = t->getCount();
if(count <= 8) {
return std::string();
}
count = std::min(count, 65535); // limit to 65535 chars to avoid crashes in case of corrupted metadata
char *buffer = new char[count - 7];
if (!strncmp((char*)t->getValue(), "ASCII\0\0\0", 8)) {
strncpy (buffer, (char*)t->getValue() + 8, t->getCount() - 8);
buffer[t->getCount() - 8] = '\0';
if (!memcmp((char*)t->getValue(), "ASCII\0\0\0", 8)) {
strncpy (buffer, (char*)t->getValue() + 8, count - 8);
buffer[count - 8] = '\0';
} else {
buffer[0] = 0;
}