Stop leaking names.

This commit is contained in:
toasterbabe 2018-01-30 21:25:28 +00:00
parent 82f2f2f2f9
commit 8090ea4ed0
1 changed files with 12 additions and 14 deletions

View File

@ -644,13 +644,12 @@ static void M_PNGhdr(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_
static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png_byte movie)
{
#ifdef PNG_TEXT_SUPPORTED
#define SRB2PNGTXT 11 //PNG_KEYWORD_MAX_LENGTH(79) is the max
#define SRB2PNGTXT 10 //PNG_KEYWORD_MAX_LENGTH(79) is the max
png_text png_infotext[SRB2PNGTXT];
char keytxt[SRB2PNGTXT][12] = {
"Title", "Author", "Description", "Playername", "Mapnum", "Mapname",
"Title", "Description", "Playername", "Mapnum", "Mapname",
"Location", "Interface", "Revision", "Build Date", "Build Time"};
char titletxt[] = "Sonic Robo Blast 2 " VERSIONSTRING;
png_charp authortxt = I_GetUserName();
png_charp playertxt = cv_playername.zstring;
char desctxt[] = "SRB2 Screenshot";
char Movietxt[] = "SRB2 Movie";
@ -700,19 +699,18 @@ static void M_PNGText(png_structp png_ptr, png_infop png_info_ptr, PNG_CONST png
png_infotext[i].key = keytxt[i];
png_infotext[0].text = titletxt;
png_infotext[1].text = authortxt;
if (movie)
png_infotext[2].text = Movietxt;
png_infotext[1].text = Movietxt;
else
png_infotext[2].text = desctxt;
png_infotext[3].text = playertxt;
png_infotext[4].text = maptext;
png_infotext[5].text = lvlttltext;
png_infotext[6].text = locationtxt;
png_infotext[7].text = interfacetxt;
png_infotext[8].text = strncpy(ctrevision, comprevision, sizeof(ctrevision)-1);
png_infotext[9].text = strncpy(ctdate, compdate, sizeof(ctdate)-1);
png_infotext[10].text = strncpy(cttime, comptime, sizeof(cttime)-1);
png_infotext[1].text = desctxt;
png_infotext[2].text = playertxt;
png_infotext[3].text = maptext;
png_infotext[4].text = lvlttltext;
png_infotext[5].text = locationtxt;
png_infotext[6].text = interfacetxt;
png_infotext[7].text = strncpy(ctrevision, comprevision, sizeof(ctrevision)-1);
png_infotext[8].text = strncpy(ctdate, compdate, sizeof(ctdate)-1);
png_infotext[9].text = strncpy(cttime, comptime, sizeof(cttime)-1);
png_set_text(png_ptr, png_info_ptr, png_infotext, SRB2PNGTXT);
#undef SRB2PNGTXT