--- xine-lib-1.1.14.orig/src/demuxers/demux_qt.c +++ xine-lib-1.1.14/src/demuxers/demux_qt.c @@ -739,49 +739,49 @@ if (current_atom == ART_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->artist = xine_xmalloc(string_size); - if (info->artist) { + if (string_size && info->artist) { strncpy(info->artist, &meta_atom[i + 20], string_size - 1); info->artist[string_size - 1] = 0; } } else if (current_atom == NAM_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->name = xine_xmalloc(string_size); - if (info->name) { + if (string_size && info->name) { strncpy(info->name, &meta_atom[i + 20], string_size - 1); info->name[string_size - 1] = 0; } } else if (current_atom == ALB_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->album = xine_xmalloc(string_size); - if (info->album) { + if (string_size && info->album) { strncpy(info->album, &meta_atom[i + 20], string_size - 1); info->album[string_size - 1] = 0; } } else if (current_atom == GEN_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->genre = xine_xmalloc(string_size); - if (info->genre) { + if (string_size && info->genre) { strncpy(info->genre, &meta_atom[i + 20], string_size - 1); info->genre[string_size - 1] = 0; } } else if (current_atom == TOO_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->comment = xine_xmalloc(string_size); - if (info->comment) { + if (string_size && info->comment) { strncpy(info->comment, &meta_atom[i + 20], string_size - 1); info->comment[string_size - 1] = 0; } } else if (current_atom == WRT_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->composer = xine_xmalloc(string_size); - if (info->composer) { + if (string_size && info->composer) { strncpy(info->composer, &meta_atom[i + 20], string_size - 1); info->composer[string_size - 1] = 0; } } else if (current_atom == DAY_ATOM) { string_size = _X_BE_32(&meta_atom[i + 4]) - 16 + 1; info->year = xine_xmalloc(string_size); - if (info->year) { + if (string_size && info->year) { strncpy(info->year, &meta_atom[i + 20], string_size - 1); info->year[string_size - 1] = 0; }