--- xvpng.c.old 2007-05-14 09:53:28 +0900 +++ xvpng.c 2010-10-11 03:06:33 +0900 @@ -1110,8 +1110,8 @@ commentsize = 1; for (i = 0; i < info_ptr->num_text; i++) - commentsize += strlen(info_ptr->text[i].key) + 1 + - info_ptr->text[i].text_length + 2; + commentsize += strlen(info_ptr->text[i].key) + 2 + + strlen(info_ptr->text[i].text) + 2; if ((pinfo->comment = malloc(commentsize)) == NULL) { png_warning(png_ptr,"can't allocate comment string");