Index: MUSHclient.cpp =================================================================== RCS file: /cvs/mushclient/MUSHclient.cpp,v retrieving revision 1.98 retrieving revision 1.100 diff -c -r1.98 -r1.100 *** MUSHclient.cpp 22 Feb 2009 03:10:14 -0000 1.98 --- MUSHclient.cpp 23 Jun 2009 23:39:23 -0000 1.100 *************** *** 299,305 **** if( rc ) { ! ::AfxMessageBox ((LPCTSTR) CFormat ("Can't open preferences database: %s", sqlite3_errmsg(db))); sqlite3_close(db); return FALSE; } --- 299,309 ---- if( rc ) { ! ::AfxMessageBox ((LPCTSTR) CFormat ("Can't open global preferences database at: %s" ! "\r\n(Error was: \"%s\")" ! "\r\nCheck you have write-access to that file.", ! m_PreferencesDatabaseName.c_str (), ! sqlite3_errmsg(db))); sqlite3_close(db); return FALSE; } *************** *** 585,593 **** m_iIconPlacement == ICON_PLACEMENT_BOTH) Frame.AddTrayIcon (); ! // Enable DDE Execute open ! EnableShellOpen(); ! RegisterShellFileTypes(); // initialise COM --- 589,601 ---- m_iIconPlacement == ICON_PLACEMENT_BOTH) Frame.AddTrayIcon (); ! // Enable DDE Execute open ! ! if (strstr (m_lpCmdLine, "/noregister") == NULL) ! { ! EnableShellOpen(); ! RegisterShellFileTypes(); ! } // initialise COM *************** *** 684,694 **** // look for /noauto command-line option if (strTemp == "/noauto") bAutoOpen = false; ! else ! if (strTemp == "/wine") { } // do nothing else, checked further up ! else ! if (strstr (strTemp, ".mcl")) // open an existing document OpenDocumentFile(m_lpCmdLine); else --- 692,702 ---- // look for /noauto command-line option if (strTemp == "/noauto") bAutoOpen = false; ! else if (strTemp == "/wine") ! { } // do nothing else, checked further up ! else if (strTemp == "/noregister") { } // do nothing else, checked further up ! else if (strstr (strTemp, ".mcl")) // open an existing document OpenDocumentFile(m_lpCmdLine); else Index: MUSHclient.h =================================================================== RCS file: /cvs/mushclient/MUSHclient.h,v retrieving revision 1.58 retrieving revision 1.59 diff -c -r1.58 -r1.59 *** MUSHclient.h 22 Feb 2009 03:10:14 -0000 1.58 --- MUSHclient.h 23 Jun 2009 23:39:23 -0000 1.59 *************** *** 15,21 **** #define DIRECTSOUND_VERSION 5 #include - #include #include ///////////////////////////////////////////////////////////////////////////// --- 15,20 ---- Index: MUSHclient.rc =================================================================== RCS file: /cvs/mushclient/MUSHclient.rc,v retrieving revision 1.233 retrieving revision 1.234 diff -c -r1.233 -r1.234 *** MUSHclient.rc 20 Feb 2009 05:51:15 -0000 1.233 --- MUSHclient.rc 25 Mar 2009 20:46:12 -0000 1.234 *************** *** 75,82 **** // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,40,0 ! PRODUCTVERSION 4,0,40,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L --- 75,82 ---- // VS_VERSION_INFO VERSIONINFO ! FILEVERSION 4,0,41,0 ! PRODUCTVERSION 4,0,41,0 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L *************** *** 94,107 **** VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.40\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2009 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.40\0" VALUE "SpecialBuild", "\0" END END --- 94,107 ---- VALUE "Comments", "MUSHclient - a client program for playing MUD games\0" VALUE "CompanyName", "Gammon Software Solutions\0" VALUE "FileDescription", "MUSHclient\0" ! VALUE "FileVersion", "4.41\0" VALUE "InternalName", "MUSHCLIENT\0" VALUE "LegalCopyright", "Copyright © 2009 Gammon Software Solutions\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "MUSHCLIENT.EXE\0" VALUE "PrivateBuild", "\0" VALUE "ProductName", "MUSHclient\0" ! VALUE "ProductVersion", "4.41\0" VALUE "SpecialBuild", "\0" END END Index: OtherTypes.h =================================================================== RCS file: /cvs/mushclient/OtherTypes.h,v retrieving revision 1.106 retrieving revision 1.107 diff -c -r1.106 -r1.107 *** OtherTypes.h 20 Feb 2009 05:51:15 -0000 1.106 --- OtherTypes.h 23 Jun 2009 23:39:23 -0000 1.107 *************** *** 1338,1343 **** --- 1338,1346 ---- LPCTSTR ReleaseCallback, long Flags); + long HotspotTooltip(LPCTSTR HotspotId, + LPCTSTR TooltipText); + }; typedef map MiniWindowMap; Index: ProcessPreviousLine.cpp =================================================================== RCS file: /cvs/mushclient/ProcessPreviousLine.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -c -r1.59 -r1.60 *** ProcessPreviousLine.cpp 6 Jan 2009 20:06:26 -0000 1.59 --- ProcessPreviousLine.cpp 23 Jun 2009 23:39:23 -0000 1.60 *************** *** 1112,1117 **** --- 1112,1120 ---- { int iCurrentCol = 0; // how far through paragraph int iCount = iEndCol - iStartCol; // how many columns to colour + if (iCount <= 0) + break; // can't exactly colour zero columns + // // Do each line (in the paragraph) // Index: Utilities.cpp =================================================================== RCS file: /cvs/mushclient/Utilities.cpp,v retrieving revision 1.79 retrieving revision 1.80 diff -c -r1.79 -r1.80 *** Utilities.cpp 26 Aug 2008 05:23:14 -0000 1.79 --- Utilities.cpp 23 Jun 2009 23:39:23 -0000 1.80 *************** *** 3122,3124 **** --- 3122,3199 ---- + #define LONGDOUBLE_TYPE long double + #define u8 unsigned char + + + // based on sqlite3AtoF - converts string to double, regardless of locale + + int myAtoF(const char *z, double *pResult) + { + int sign = 1; + const char *zBegin = z; + LONGDOUBLE_TYPE v1 = 0.0; + int nSignificant = 0; + while( isspace(*(u8*)z) ) z++; + if( *z=='-' ){ + sign = -1; + z++; + }else if( *z=='+' ){ + z++; + } + while( z[0]=='0' ){ + z++; + } + while( isdigit(*(u8*)z) ){ + v1 = v1*10.0 + (*z - '0'); + z++; + nSignificant++; + } + if( *z=='.' ){ + LONGDOUBLE_TYPE divisor = 1.0; + z++; + if( nSignificant==0 ){ + while( z[0]=='0' ){ + divisor *= 10.0; + z++; + } + } + while( isdigit(*(u8*)z) ){ + if( nSignificant<18 ){ + v1 = v1*10.0 + (*z - '0'); + divisor *= 10.0; + nSignificant++; + } + z++; + } + v1 /= divisor; + } + if( *z=='e' || *z=='E' ){ + int esign = 1; + int eval = 0; + LONGDOUBLE_TYPE scale = 1.0; + z++; + if( *z=='-' ){ + esign = -1; + z++; + }else if( *z=='+' ){ + z++; + } + while( isdigit(*(u8*)z) ){ + eval = eval*10 + *z - '0'; + z++; + } + while( eval>=64 ){ scale *= 1.0e+64; eval -= 64; } + while( eval>=16 ){ scale *= 1.0e+16; eval -= 16; } + while( eval>=4 ){ scale *= 1.0e+4; eval -= 4; } + while( eval>=1 ){ scale *= 1.0e+1; eval -= 1; } + if( esign<0 ){ + v1 /= scale; + }else{ + v1 *= scale; + } + } + *pResult = (double)(sign<0 ? -v1 : v1); + return (int)(z - zBegin); + } // end of myAtoF + Index: doc.cpp =================================================================== RCS file: /cvs/mushclient/doc.cpp,v retrieving revision 1.265 retrieving revision 1.267 diff -c -r1.265 -r1.267 *** doc.cpp 23 Feb 2009 01:56:41 -0000 1.265 --- doc.cpp 23 Jun 2009 23:39:23 -0000 1.267 *************** *** 579,584 **** --- 579,586 ---- DISP_FUNCTION(CMUSHclientDoc, "DatabaseColumnNames", DatabaseColumnNames, VT_VARIANT, VTS_BSTR) DISP_FUNCTION(CMUSHclientDoc, "DatabaseColumnValues", DatabaseColumnValues, VT_VARIANT, VTS_BSTR) DISP_FUNCTION(CMUSHclientDoc, "DatabaseReset", DatabaseReset, VT_I4, VTS_BSTR) + DISP_FUNCTION(CMUSHclientDoc, "FlashIcon", FlashIcon, VT_EMPTY, VTS_NONE) + DISP_FUNCTION(CMUSHclientDoc, "WindowHotspotTooltip", WindowHotspotTooltip, VT_I4, VTS_BSTR VTS_BSTR VTS_BSTR) DISP_PROPERTY_PARAM(CMUSHclientDoc, "NormalColour", GetNormalColour, SetNormalColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "BoldColour", GetBoldColour, SetBoldColour, VT_I4, VTS_I2) DISP_PROPERTY_PARAM(CMUSHclientDoc, "CustomColourText", GetCustomColourText, SetCustomColourText, VT_I4, VTS_I2) *************** *** 1511,1517 **** // in the Unicode case we are allocating 4 bytes per character so we shouldn't // overshoot the allocated memory, but just in case, we test that we don't ! if ((iLineLength >= m_nWrapColumn && bNewCharacter) || // usual case (m_pCurrentLine->len >= m_pCurrentLine->iMemoryAllocated)) // emergency bail-out { --- 1513,1519 ---- // in the Unicode case we are allocating 4 bytes per character so we shouldn't // overshoot the allocated memory, but just in case, we test that we don't ! if (((iLineLength >= m_nWrapColumn) && bNewCharacter) || // usual case (m_pCurrentLine->len >= m_pCurrentLine->iMemoryAllocated)) // emergency bail-out { *************** *** 2241,2246 **** --- 2243,2249 ---- if (hard_break) { CLine * pSavedLine = m_pCurrentLine; + LARGE_INTEGER saved_time = m_pCurrentLine->m_lineHighPerformanceTime; if (ProcessPreviousLine () && m_pCurrentLine->len == 0) return; // return if omit from output (no need to add another line) *************** *** 2251,2257 **** // (see forum subject 2320 - a script might have done a world.colourtell // which would leave a line which was not terminated). ! if (pSavedLine != m_pCurrentLine && m_pCurrentLine->len == 0) return; --- 2254,2263 ---- // (see forum subject 2320 - a script might have done a world.colourtell // which would leave a line which was not terminated). ! // added in version 4.41, also check timestamp, due to problem with lines being deleted ! // by DeleteLines in a trigger script. ! if ((pSavedLine != m_pCurrentLine || ! saved_time.QuadPart != m_pCurrentLine->m_lineHighPerformanceTime.QuadPart) && m_pCurrentLine->len == 0) return; *************** *** 7997,8000 **** --- 8003,8008 ---- m_strSpecialFontName.Empty (); } + + Index: doc.h =================================================================== RCS file: /cvs/mushclient/doc.h,v retrieving revision 1.282 retrieving revision 1.284 diff -c -r1.282 -r1.284 *** doc.h 23 Feb 2009 01:56:41 -0000 1.282 --- doc.h 23 Jun 2009 23:39:23 -0000 1.284 *************** *** 21,28 **** // New versions - things to change ! #define THISVERSION 440 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.40"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT --- 21,28 ---- // New versions - things to change ! #define THISVERSION 441 // Step 1. ! const CString MUSHCLIENT_VERSION = "4.41"; // Step 2. // Step 3. Don't forget VERSION resource in Resources tab // Step 4. Remember: README.TXT *************** *** 2553,2558 **** --- 2553,2560 ---- afx_msg VARIANT DatabaseColumnNames(LPCTSTR Name); afx_msg VARIANT DatabaseColumnValues(LPCTSTR Name); afx_msg long DatabaseReset(LPCTSTR Name); + afx_msg void FlashIcon(); + afx_msg long WindowHotspotTooltip(LPCTSTR Name, LPCTSTR HotspotId, LPCTSTR TooltipText); afx_msg long GetNormalColour(short WhichColour); afx_msg void SetNormalColour(short WhichColour, long nNewValue); afx_msg long GetBoldColour(short WhichColour); Index: functionlist.cpp =================================================================== RCS file: /cvs/mushclient/functionlist.cpp,v retrieving revision 1.61 retrieving revision 1.63 diff -c -r1.61 -r1.63 *** functionlist.cpp 23 Feb 2009 01:56:41 -0000 1.61 --- functionlist.cpp 23 Jun 2009 23:39:23 -0000 1.63 *************** *** 147,152 **** --- 147,153 ---- "FilterPixel", "FixupEscapeSequences", "FixupHTML", + "FlashIcon", "FlushLog", "GenerateName", "GetAlias", *************** *** 387,392 **** --- 388,394 ---- "WindowGetPixel", "WindowHotspotInfo", "WindowHotspotList", + "WindowHotspotTooltip", "WindowImageFromWindow", "WindowImageInfo", "WindowImageList", Index: lsqlite3.c =================================================================== RCS file: /cvs/mushclient/lsqlite3.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** lsqlite3.c 21 Feb 2009 19:49:19 -0000 1.1 --- lsqlite3.c 25 Mar 2009 20:46:12 -0000 1.2 *************** *** 1,7 **** // These first few lines added by NJG // version 0.6-devel # pragma warning(disable: 4244) ! /************************************************************************ * lsqlite3 * --- 1,7 ---- // These first few lines added by NJG // version 0.6-devel # pragma warning(disable: 4244) ! // Warning - in db_last_insert_rowid change %ll to %I64d /************************************************************************ * lsqlite3 * *************** *** 832,838 **** if (n == rowid) lua_pushnumber(L, n); else ! lua_pushfstring(L, "%ll", rowid); return 1; } --- 832,838 ---- if (n == rowid) lua_pushnumber(L, n); else ! lua_pushfstring(L, "%I64d", rowid); // NJG return 1; } Index: lua_methods.cpp =================================================================== RCS file: /cvs/mushclient/lua_methods.cpp,v retrieving revision 1.121 retrieving revision 1.123 diff -c -r1.121 -r1.123 *** lua_methods.cpp 23 Feb 2009 01:56:41 -0000 1.121 --- lua_methods.cpp 23 Jun 2009 23:39:23 -0000 1.123 *************** *** 2165,2170 **** --- 2165,2179 ---- return pushBstr (L, str); // number of result fields } // end of L_FixupHTML + //---------------------------------------- + // world.FlashIcon + //---------------------------------------- + static int L_FlashIcon (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + pDoc->FlashIcon (); + return 0; // number of result fields + } // end of L_FlashIcon //---------------------------------------- // world.FlushLog *************** *** 5610,5615 **** --- 5619,5639 ---- } // end of L_WindowHotspotList //---------------------------------------- + // world.WindowHotspotTooltip + //---------------------------------------- + static int L_WindowHotspotTooltip (lua_State *L) + { + CMUSHclientDoc *pDoc = doc (L); + lua_pushnumber (L, pDoc->WindowHotspotTooltip ( + my_checkstring (L, 1), // Name + my_checkstring (L, 2), // HotspotId + my_checkstring (L, 3) // TooltipText + )); + + return 1; + } // end of L_WindowHotspotTooltip + + //---------------------------------------- // world.WindowImageFromWindow //---------------------------------------- static int L_WindowImageFromWindow (lua_State *L) *************** *** 6094,6099 **** --- 6118,6124 ---- {"FilterPixel", L_FilterPixel}, {"FixupEscapeSequences", L_FixupEscapeSequences}, {"FixupHTML", L_FixupHTML}, + {"FlashIcon", L_FlashIcon}, {"FlushLog", L_FlushLog}, {"GenerateName", L_GenerateName}, {"GetAlias", L_GetAlias}, *************** *** 6344,6349 **** --- 6369,6375 ---- {"WindowGradient", L_WindowGradient}, {"WindowHotspotInfo", L_WindowHotspotInfo}, {"WindowHotspotList", L_WindowHotspotList}, + {"WindowHotspotTooltip", L_WindowHotspotTooltip}, {"WindowImageFromWindow", L_WindowImageFromWindow}, {"WindowImageInfo", L_WindowImageInfo}, {"WindowImageList", L_WindowImageList}, Index: lua_scripting.cpp =================================================================== RCS file: /cvs/mushclient/lua_scripting.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -c -r1.46 -r1.47 *** lua_scripting.cpp 21 Feb 2009 19:47:05 -0000 1.46 --- lua_scripting.cpp 25 Mar 2009 20:46:12 -0000 1.47 *************** *** 122,127 **** --- 122,129 ---- "math", "debug", "coroutine", + "lpeg", + "sqlite3", // add more tables here Index: methods.cpp =================================================================== RCS file: /cvs/mushclient/methods.cpp,v retrieving revision 1.261 retrieving revision 1.263 diff -c -r1.261 -r1.263 *** methods.cpp 23 Feb 2009 01:56:42 -0000 1.261 --- methods.cpp 23 Jun 2009 23:39:23 -0000 1.263 *************** *** 4178,4183 **** --- 4178,4184 ---- { 115, "Localization active" }, { 116, "Outgoing MUD-specific codes requested" }, { 117, "Incoming MUD-specific codes expected" }, + { 118, "Variables have changed" }, // (numbers (longs) - calculated at runtime) *************** *** 4498,4503 **** --- 4499,4506 ---- case 115: SetUpVariantBool (vaResult, App.m_Translator_Lua != NULL); break; case 116: SetUpVariantBool (vaResult, m_bOutgoing_MUD_specific); break; case 117: SetUpVariantBool (vaResult, m_bIncoming_MUD_specific); break; + case 118: SetUpVariantBool (vaResult, m_bVariablesChanged); break; + case 201: SetUpVariantLong (vaResult, m_total_lines); break; case 202: SetUpVariantLong (vaResult, m_new_lines); break; *************** *** 8783,8789 **** // do it Load_World_XML (ar, ! // don't load plugins or general world config here ~(XML_PLUGINS | XML_NO_PLUGINS | XML_GENERAL), 0, // load flags &iTriggers, --- 8786,8792 ---- // do it Load_World_XML (ar, ! // don't load plugins or general world config here (note, this sets XML_OVERWRITE) ~(XML_PLUGINS | XML_NO_PLUGINS | XML_GENERAL), 0, // load flags &iTriggers, *************** *** 11591,11596 **** --- 11594,11600 ---- m_pLinePositions [m_LineList.GetCount () / JUMP_SIZE] = pos; } + // notify view to invalidate this part for(pos = GetFirstViewPosition(); pos != NULL; ) *************** *** 13969,13978 **** pDatabase->iColumns = 0; } ! else if (it->second->db_name == Filename) ! return SQLITE_OK; // OK to re-use same database ! else ! return -6; // database already exists under this id but a different disk name int rc = sqlite3_open_v2 (Filename, &pDatabase->db, Flags, NULL); --- 13973,13985 ---- pDatabase->iColumns = 0; } ! else ! { ! if (it->second->db_name == Filename) ! return SQLITE_OK; // OK to re-use same database ! else ! return -6; // database already exists under this id but a different disk name ! } int rc = sqlite3_open_v2 (Filename, &pDatabase->db, Flags, NULL); *************** *** 14501,14506 **** --- 14508,14531 ---- return sqlite3_reset(it->second->pStmt); // reset statement } // end of CMUSHclientDoc::DatabaseReset + + + void CMUSHclientDoc::FlashIcon() + { + Frame.FlashWindow (TRUE); + } + + + long CMUSHclientDoc::WindowHotspotTooltip(LPCTSTR Name, LPCTSTR HotspotId, LPCTSTR TooltipText) + { + + MiniWindowMapIterator it = m_MiniWindows.find (Name); + + if (it == m_MiniWindows.end ()) + return eNoSuchWindow; + + return it->second->HotspotTooltip (HotspotId, TooltipText); + } /* Index: miniwindow.cpp =================================================================== RCS file: /cvs/mushclient/miniwindow.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -c -r1.37 -r1.38 *** miniwindow.cpp 21 Feb 2009 19:47:05 -0000 1.37 --- miniwindow.cpp 23 Jun 2009 23:39:23 -0000 1.38 *************** *** 1597,1603 **** if (it != m_Hotspots.end ()) { ! delete it->second; // delete existing font m_Hotspots.erase (it); if (m_sMouseOverHotspot == HotspotId) m_sMouseOverHotspot.erase (); --- 1597,1603 ---- if (it != m_Hotspots.end ()) { ! delete it->second; // delete existing hotspot m_Hotspots.erase (it); if (m_sMouseOverHotspot == HotspotId) m_sMouseOverHotspot.erase (); *************** *** 3624,3626 **** --- 3624,3642 ---- } // end of CMiniWindow::DragHandler + // changes hotspot tooltip text + long CMiniWindow::HotspotTooltip(LPCTSTR HotspotId, + LPCTSTR TooltipText) + { + + HotspotMapIterator it = m_Hotspots.find (HotspotId); + + if (it == m_Hotspots.end ()) + return eHotspotNotInstalled; + + CHotspot * pHotspot = it->second; + + pHotspot->m_sTooltipText = TooltipText; + + return eOK; + } // end of CMiniWindow::HotspotTooltip Index: mushclient.cnt =================================================================== RCS file: /cvs/mushclient/mushclient.cnt,v retrieving revision 1.61 retrieving revision 1.63 diff -c -r1.61 -r1.63 *** mushclient.cnt 23 Feb 2009 01:56:42 -0000 1.61 --- mushclient.cnt 23 Jun 2009 23:39:23 -0000 1.63 *************** *** 293,298 **** --- 293,299 ---- 3 FilterPixel=FNC_FilterPixel 3 FixupEscapeSequences=FNC_FixupEscapeSequences 3 FixupHTML=FNC_FixupHTML + 3 FlashIcon=FNC_FlashIcon 3 FlushLog=FNC_FlushLog 3 GenerateName=FNC_GenerateName 3 GetAlias=FNC_GetAlias *************** *** 537,542 **** --- 538,544 ---- 3 WindowImageOp=FNC_WindowImageOp 3 WindowHotspotInfo=FNC_WindowHotspotInfo 3 WindowHotspotList=FNC_WindowHotspotList + 3 WindowHotspotTooltip=FNC_WindowHotspotTooltip 3 WindowInfo=FNC_WindowInfo 3 WindowLine=FNC_WindowLine 3 WindowList=FNC_WindowList Index: mushclient.hlp =================================================================== RCS file: /cvs/mushclient/mushclient.hlp,v retrieving revision 1.106 retrieving revision 1.108 diff -c -r1.106 -r1.108 Binary files /tmp/cvsnqZv84 and /tmp/cvsNdTwCX differ Index: mushclient.odl =================================================================== RCS file: /cvs/mushclient/mushclient.odl,v retrieving revision 1.145 retrieving revision 1.147 diff -c -r1.145 -r1.147 *** mushclient.odl 23 Feb 2009 01:56:42 -0000 1.145 --- mushclient.odl 23 Jun 2009 23:40:20 -0000 1.147 *************** *** 70,83 **** [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(395), propget] long NormalColour(short WhichColour); ! [id(395), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(396), propget] long BoldColour(short WhichColour); ! [id(396), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(397), propget] long CustomColourText(short WhichColour); ! [id(397), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(398), propget] long CustomColourBackground(short WhichColour); ! [id(398), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); --- 70,83 ---- [id(44)] long SetCommand(BSTR Message); [id(45)] BSTR GetNotes(); [id(46)] void SetNotes(BSTR Message); ! [id(397), propget] long NormalColour(short WhichColour); ! [id(397), propput] void NormalColour(short WhichColour, long nNewValue); ! [id(398), propget] long BoldColour(short WhichColour); ! [id(398), propput] void BoldColour(short WhichColour, long nNewValue); ! [id(399), propget] long CustomColourText(short WhichColour); ! [id(399), propput] void CustomColourText(short WhichColour, long nNewValue); ! [id(400), propget] long CustomColourBackground(short WhichColour); ! [id(400), propput] void CustomColourBackground(short WhichColour, long nNewValue); [id(47)] void Redraw(); [id(48)] long ResetTimer(BSTR TimerName); [id(49)] void SetOutputFont(BSTR FontName, short PointSize); *************** *** 426,431 **** --- 426,433 ---- [id(392)] VARIANT DatabaseColumnNames(BSTR Name); [id(393)] VARIANT DatabaseColumnValues(BSTR Name); [id(394)] long DatabaseReset(BSTR Name); + [id(395)] void FlashIcon(); + [id(396)] long WindowHotspotTooltip(BSTR Name, BSTR HotspotId, BSTR TooltipText); //}}AFX_ODL_METHOD }; Index: mushview.cpp =================================================================== RCS file: /cvs/mushclient/mushview.cpp,v retrieving revision 1.121 retrieving revision 1.123 diff -c -r1.121 -r1.123 *** mushview.cpp 20 Feb 2009 05:51:15 -0000 1.121 --- mushview.cpp 23 Jun 2009 23:40:20 -0000 1.123 *************** *** 31,63 **** #if REDRAW_DEBUG ! #define TYPE_OF_RECT_FILL FillRect ! // #define TYPE_OF_RECT_FILL FrameRect ! #define TYPE_OF_RGN_FILL FillRgn ! // #define TYPE_OF_RGN_FILL FrameRgn ! ! void ShowInvalidatedRect (CMUSHView * pView, RECT & r, ! COLORREF colour = RGB (0, 255, 255)) // cyan? ! { ! CClientDC dc(pView); ! CBrush br; ! br.CreateSolidBrush (colour); ! dc.TYPE_OF_RECT_FILL (&r, &br); ! Sleep (500); // pause so we can see it ! } // end of ShowInvalidatedRect ! ! void ShowInvalidatedRgn (CMUSHView * pView, CRgn & r) ! { ! CClientDC dc(pView); ! CBrush br; ! br.CreateSolidBrush (RGB (0, 255, 255)); // cyan? ! dc.TYPE_OF_RGN_FILL (&r, &br); ! Sleep (500); // pause so we can see it ! } // end of ShowInvalidatedRgn ! #endif CString strMXP_menu_item [MXP_MENU_COUNT]; #define ACTION_ALIAS 1 // dummy action type for alias menus --- 31,77 ---- #if REDRAW_DEBUG ! #define TYPE_OF_RECT_FILL FillRect ! // #define TYPE_OF_RECT_FILL FrameRect ! #define TYPE_OF_RGN_FILL FillRgn ! // #define TYPE_OF_RGN_FILL FrameRgn ! void ShowInvalidatedRect (CMUSHView * pView, RECT & r, ! COLORREF colour = RGB (0, 255, 255)) // cyan? ! { ! CClientDC dc(pView); ! CBrush br; ! br.CreateSolidBrush (colour); ! dc.TYPE_OF_RECT_FILL (&r, &br); ! Sleep (500); // pause so we can see it ! } // end of ShowInvalidatedRect ! ! void ShowInvalidatedRgn (CMUSHView * pView, CRgn & r) ! { ! CClientDC dc(pView); ! CBrush br; ! br.CreateSolidBrush (RGB (0, 255, 255)); // cyan? ! dc.TYPE_OF_RGN_FILL (&r, &br); ! Sleep (500); // pause so we can see it ! } // end of ShowInvalidatedRgn ! ! #endif // REDRAW_DEBUG + #define TTI_NONE 0 // no icon + #define TTI_INFO 1 // information icon + #define TTI_WARNING 2 // warning icon + #define TTI_ERROR 3 // error icon + + + #define TTM_SETTITLEA (WM_USER+32) + #define TTM_SETTITLEW (WM_USER+33) + #define TTM_SETTITLE TTM_SETTITLEA + #define TTM_POPUP (WM_USER+34) + #define TTM_GETTITLE (WM_USER+35) + #define TTM_SETWINDOWTHEME CCM_SETWINDOWTHEME + + CString strMXP_menu_item [MXP_MENU_COUNT]; #define ACTION_ALIAS 1 // dummy action type for alias menus *************** *** 1301,1312 **** FixupTitle (); ! if (m_ToolTip.Create(this, TTS_ALWAYSTIP) && m_ToolTip.AddTool(this)) { m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX); m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 5000); m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 400); m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, 400); } else { --- 1315,1336 ---- FixupTitle (); ! if (m_ToolTip.Create(this, TTS_ALWAYSTIP | TTS_NOPREFIX | 0x40) && m_ToolTip.AddTool(this)) { m_ToolTip.SendMessage(TTM_SETMAXTIPWIDTH, 0, SHRT_MAX); m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_AUTOPOP, 5000); m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_INITIAL, 400); m_ToolTip.SendMessage(TTM_SETDELAYTIME, TTDT_RESHOW, 400); + + // add icon and title to tooltip + // TTI_NONE = 0 - no icon + // TTI_INFO = 1 - information icon + // TTI_WARNING = 2 - warning icon + // TTI_ERROR = 3 - error icon + + m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) Translate ("Line information") ); + + m_ToolTip.SetMaxTipWidth(500); } else { *************** *** 4019,4024 **** --- 4043,4050 ---- // don't do it *past* end of last word long pixel = calculate_width (line, pLine->len, pDoc, dc) + pDoc->m_iPixelOffset + pDoc->m_TextRectangle.left; + m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) Translate ("Line information") ); + if (CursorPos.x < pixel && pDoc->FindStyle (pLine, col, iCol, pStyle, foundpos)) { *************** *** 4048,4054 **** --- 4074,4084 ---- // or the hint for the first action item if (!hintsList.IsEmpty ()) + { strText = hintsList.GetHead (); + // don't say "Line information" for MXP hints + m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) "" ); + } } // end of ACTION_SEND or ACTION_PROMPT else *************** *** 4059,4066 **** --- 4089,4099 ---- else strText = pStyle->pAction->m_strHint; + // don't say "Line information" for MXP hints + m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) "" ); } // end of ACTION_HYPERLINK + } // end of column found // here for just the line information *************** *** 4089,4095 **** p); } // end of not being a hyperlink ! ::strcpy(pTTT->szText, strText.Left (sizeof(pTTT->szText) - 1)); } // end of line being in range (ie. cursor over actual line) bHandledNotify = TRUE; --- 4122,4136 ---- p); } // end of not being a hyperlink ! // ::strcpy(pTTT->szText, strText.Left (sizeof(pTTT->szText) - 1)); ! ! // allow more text ! static char buf [1000]; ! strcpy (buf, strText.Left (sizeof(buf) - 1)); ! pTTT->lpszText = buf; ! ! ! return TRUE; } // end of line being in range (ie. cursor over actual line) bHandledNotify = TRUE; *************** *** 6524,6529 **** --- 6565,6571 ---- } // end of CMUSHView::Mouse_Up_MiniWindow + // version 4.41 onwards - you can have title \t body (title and body separated by a tab) bool CMUSHView::Mouse_Tooltip_MiniWindow (CMUSHclientDoc* pDoc, CPoint point, NMHDR * pNMHDR) { // see if we clicked over one of our miniwindows *************** *** 6540,6552 **** TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; if (pHotspot && !pHotspot->m_sTooltipText.empty ()) { ! ::strncpy(pTTT->szText, pHotspot->m_sTooltipText.c_str (), sizeof(pTTT->szText) - 1); ! pTTT->szText [sizeof(pTTT->szText) - 1] = 0; // force string end } else ! pTTT->szText [0] = 0; // cursor is not over a hotspot return true; --- 6582,6621 ---- TOOLTIPTEXT *pTTT = (TOOLTIPTEXT *)pNMHDR; + static char buf [1000]; + if (pHotspot && !pHotspot->m_sTooltipText.empty ()) { ! string s = pHotspot->m_sTooltipText; ! string delim = "\t"; ! ! // find delimiter ! string::size_type i (s.find (delim)); ! ! // split into before and after delimiter ! string body (s.substr (0, i)); ! ! // if no delimiter, no title ! if (i == string::npos) ! m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) "" ); ! else ! { ! string title = body; ! body = s.substr (i + delim.size (), string::npos); ! m_ToolTip.SendMessage (TTM_SETTITLE, TTI_INFO, (LPARAM) title.c_str ()); ! } ! ! // allow more text ! strcpy (buf, body.substr (0, (sizeof buf) - 1).c_str ()); ! pTTT->lpszText = buf; ! } else ! { ! buf [0] = 0; // cursor is not over a hotspot ! pTTT->lpszText = buf; ! } ! return true; *************** *** 6827,6833 **** *rect = GetTextRectangle (); } // end of CMUSHView::GetTextRect ! // returns the text rectangle, if any, noramlized RECT CMUSHView::GetTextRectangle (const bool bIncludeBorder) { CMUSHclientDoc* pDoc = GetDocument(); --- 6896,6902 ---- *rect = GetTextRectangle (); } // end of CMUSHView::GetTextRect ! // returns the text rectangle, if any, normalized RECT CMUSHView::GetTextRectangle (const bool bIncludeBorder) { CMUSHclientDoc* pDoc = GetDocument(); Index: plugins.cpp =================================================================== RCS file: /cvs/mushclient/plugins.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -c -r1.46 -r1.47 *** plugins.cpp 14 Feb 2009 04:52:56 -0000 1.46 --- plugins.cpp 23 Jun 2009 23:40:20 -0000 1.47 *************** *** 695,702 **** propSheet.m_Page1.m_strVersion = "1.0"; propSheet.m_Page1.m_bRemoveItems = true; ! char * stopstring; ! propSheet.m_Page1.m_fRequires = strtod (MUSHCLIENT_VERSION, &stopstring); POSITION pos; CString strName; --- 695,701 ---- propSheet.m_Page1.m_strVersion = "1.0"; propSheet.m_Page1.m_bRemoveItems = true; ! myAtoF (MUSHCLIENT_VERSION, &propSheet.m_Page1.m_fRequires); POSITION pos; CString strName; Index: png.c =================================================================== RCS file: /cvs/mushclient/png.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** png.c 25 Aug 2008 02:47:14 -0000 1.1 --- png.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,7 **** /* png.c - location for general purpose libpng functions * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) --- 1,7 ---- /* png.c - location for general purpose libpng functions * ! * Last changed in libpng 1.2.34 [December 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) *************** *** 13,19 **** #include "png.h" /* Generate a compiler error if there is an old png.h in the search path. */ ! typedef version_1_2_31 Your_png_h_is_not_version_1_2_31; /* Version information for C files. This had better match the version * string defined in png.h. */ --- 13,19 ---- #include "png.h" /* Generate a compiler error if there is an old png.h in the search path. */ ! typedef version_1_2_35 Your_png_h_is_not_version_1_2_35; /* Version information for C files. This had better match the version * string defined in png.h. */ *************** *** 93,99 **** png_set_sig_bytes(png_structp png_ptr, int num_bytes) { if (png_ptr == NULL) return; ! png_debug(1, "in png_set_sig_bytes\n"); if (num_bytes > 8) png_error(png_ptr, "Too many bytes for PNG signature."); --- 93,99 ---- png_set_sig_bytes(png_structp png_ptr, int num_bytes) { if (png_ptr == NULL) return; ! png_debug(1, "in png_set_sig_bytes"); if (num_bytes > 8) png_error(png_ptr, "Too many bytes for PNG signature."); *************** *** 240,246 **** { png_infop info_ptr; ! png_debug(1, "in png_create_info_struct\n"); if (png_ptr == NULL) return (NULL); #ifdef PNG_USER_MEM_SUPPORTED info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO, --- 240,246 ---- { png_infop info_ptr; ! png_debug(1, "in png_create_info_struct"); if (png_ptr == NULL) return (NULL); #ifdef PNG_USER_MEM_SUPPORTED info_ptr = (png_infop)png_create_struct_2(PNG_STRUCT_INFO, *************** *** 265,271 **** png_infop info_ptr = NULL; if (png_ptr == NULL) return; ! png_debug(1, "in png_destroy_info_struct\n"); if (info_ptr_ptr != NULL) info_ptr = *info_ptr_ptr; --- 265,271 ---- png_infop info_ptr = NULL; if (png_ptr == NULL) return; ! png_debug(1, "in png_destroy_info_struct"); if (info_ptr_ptr != NULL) info_ptr = *info_ptr_ptr; *************** *** 304,310 **** if (info_ptr == NULL) return; ! png_debug(1, "in png_info_init_3\n"); if (png_sizeof(png_info) > png_info_struct_size) { --- 304,310 ---- if (info_ptr == NULL) return; ! png_debug(1, "in png_info_init_3"); if (png_sizeof(png_info) > png_info_struct_size) { *************** *** 322,328 **** png_data_freer(png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask) { ! png_debug(1, "in png_data_freer\n"); if (png_ptr == NULL || info_ptr == NULL) return; if (freer == PNG_DESTROY_WILL_FREE_DATA) --- 322,328 ---- png_data_freer(png_structp png_ptr, png_infop info_ptr, int freer, png_uint_32 mask) { ! png_debug(1, "in png_data_freer"); if (png_ptr == NULL || info_ptr == NULL) return; if (freer == PNG_DESTROY_WILL_FREE_DATA) *************** *** 339,345 **** png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num) { ! png_debug(1, "in png_free_data\n"); if (png_ptr == NULL || info_ptr == NULL) return; --- 339,345 ---- png_free_data(png_structp png_ptr, png_infop info_ptr, png_uint_32 mask, int num) { ! png_debug(1, "in png_free_data"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 593,599 **** void /* PRIVATE */ png_info_destroy(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_info_destroy\n"); png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); --- 593,599 ---- void /* PRIVATE */ png_info_destroy(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_info_destroy"); png_free_data(png_ptr, info_ptr, PNG_FREE_ALL, -1); *************** *** 632,638 **** void PNGAPI png_init_io(png_structp png_ptr, png_FILE_p fp) { ! png_debug(1, "in png_init_io\n"); if (png_ptr == NULL) return; png_ptr->io_ptr = (png_voidp)fp; } --- 632,638 ---- void PNGAPI png_init_io(png_structp png_ptr, png_FILE_p fp) { ! png_debug(1, "in png_init_io"); if (png_ptr == NULL) return; png_ptr->io_ptr = (png_voidp)fp; } *************** *** 694,700 **** png_get_copyright(png_structp png_ptr) { png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */ ! return ((png_charp) "\n libpng version 1.2.31 - August 21, 2008\n\ Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\ Copyright (c) 1996-1997 Andreas Dilger\n\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n"); --- 694,700 ---- png_get_copyright(png_structp png_ptr) { png_ptr = png_ptr; /* silence compiler warning about unused png_ptr */ ! return ((png_charp) "\n libpng version 1.2.35 - February 14, 2009\n\ Copyright (c) 1998-2008 Glenn Randers-Pehrson\n\ Copyright (c) 1996-1997 Andreas Dilger\n\ Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.\n"); *************** *** 796,799 **** --- 796,911 ---- return ((png_size_t)size); } #endif /* PNG_SIZE_T */ + + /* Added at libpng version 1.2.34 and 1.4.0 (moved from pngset.c) */ + #if defined(PNG_cHRM_SUPPORTED) + #if !defined(PNG_NO_CHECK_cHRM) + /* + Multiply two 32-bit numbers, V1 and V2, using 32-bit + arithmetic, to produce a 64 bit result in the HI/LO words. + + A B + x C D + ------ + AD || BD + AC || CB || 0 + + where A and B are the high and low 16-bit words of V1, + C and D are the 16-bit words of V2, AD is the product of + A and D, and X || Y is (X << 16) + Y. + */ + + void png_64bit_product (long v1, long v2, unsigned long *hi_product, + unsigned long *lo_product) + { + int a, b, c, d; + long lo, hi, x, y; + + a = (v1 >> 16) & 0xffff; + b = v1 & 0xffff; + c = (v2 >> 16) & 0xffff; + d = v2 & 0xffff; + + lo = b * d; /* BD */ + x = a * d + c * b; /* AD + CB */ + y = ((lo >> 16) & 0xffff) + x; + + lo = (lo & 0xffff) | ((y & 0xffff) << 16); + hi = (y >> 16) & 0xffff; + + hi += a * c; /* AC */ + + *hi_product = (unsigned long)hi; + *lo_product = (unsigned long)lo; + } + int /* private */ + png_check_cHRM_fixed(png_structp png_ptr, + png_fixed_point white_x, png_fixed_point white_y, png_fixed_point red_x, + png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, + png_fixed_point blue_x, png_fixed_point blue_y) + { + int ret = 1; + unsigned long xy_hi,xy_lo,yx_hi,yx_lo; + + png_debug(1, "in function png_check_cHRM_fixed"); + if (png_ptr == NULL) + return 0; + + if (white_x < 0 || white_y <= 0 || + red_x < 0 || red_y < 0 || + green_x < 0 || green_y < 0 || + blue_x < 0 || blue_y < 0) + { + png_warning(png_ptr, + "Ignoring attempt to set negative chromaticity value"); + ret = 0; + } + if (white_x > (png_fixed_point) PNG_UINT_31_MAX || + white_y > (png_fixed_point) PNG_UINT_31_MAX || + red_x > (png_fixed_point) PNG_UINT_31_MAX || + red_y > (png_fixed_point) PNG_UINT_31_MAX || + green_x > (png_fixed_point) PNG_UINT_31_MAX || + green_y > (png_fixed_point) PNG_UINT_31_MAX || + blue_x > (png_fixed_point) PNG_UINT_31_MAX || + blue_y > (png_fixed_point) PNG_UINT_31_MAX ) + { + png_warning(png_ptr, + "Ignoring attempt to set chromaticity value exceeding 21474.83"); + ret = 0; + } + if (white_x > 100000L - white_y) + { + png_warning(png_ptr, "Invalid cHRM white point"); + ret = 0; + } + if (red_x > 100000L - red_y) + { + png_warning(png_ptr, "Invalid cHRM red point"); + ret = 0; + } + if (green_x > 100000L - green_y) + { + png_warning(png_ptr, "Invalid cHRM green point"); + ret = 0; + } + if (blue_x > 100000L - blue_y) + { + png_warning(png_ptr, "Invalid cHRM blue point"); + ret = 0; + } + + png_64bit_product(green_x - red_x, blue_y - red_y, &xy_hi, &xy_lo); + png_64bit_product(green_y - red_y, blue_x - red_x, &yx_hi, &yx_lo); + + if (xy_hi == yx_hi && xy_lo == yx_lo) + { + png_warning(png_ptr, + "Ignoring attempt to set cHRM RGB triangle with zero area"); + ret = 0; + } + + return ret; + } + #endif /* NO_PNG_CHECK_cHRM */ + #endif /* PNG_cHRM_SUPPORTED */ #endif /* defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED) */ Index: png.h =================================================================== RCS file: /cvs/mushclient/png.h,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** png.h 25 Aug 2008 02:47:14 -0000 1.1 --- png.h 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,14 **** /* png.h - header file for PNG reference library * ! * libpng version 1.2.31 - August 21, 2008 ! * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger ! * libpng versions 0.97, January 1998, through 1.2.31 - August 21, 2008: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: --- 1,14 ---- /* png.h - header file for PNG reference library * ! * libpng version 1.2.35 - February 14, 2009 ! * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger ! * libpng versions 0.97, January 1998, through 1.2.35 - February 14, 2009: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: *************** *** 198,207 **** * 1.2.30rc01-08 13 10230 12.so.0.30[.0] * 1.0.38 10 10038 10.so.0.38[.0] * 1.2.30 13 10230 12.so.0.30[.0] ! * 1.0.38rc01-03 10 10039 10.so.0.39[.0] * 1.2.31rc01-03 13 10231 12.so.0.31[.0] ! * 1.0.38 10 10039 10.so.0.39[.0] * 1.2.31 13 10231 12.so.0.31[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be --- 198,227 ---- * 1.2.30rc01-08 13 10230 12.so.0.30[.0] * 1.0.38 10 10038 10.so.0.38[.0] * 1.2.30 13 10230 12.so.0.30[.0] ! * 1.0.39rc01-03 10 10039 10.so.0.39[.0] * 1.2.31rc01-03 13 10231 12.so.0.31[.0] ! * 1.0.39 10 10039 10.so.0.39[.0] * 1.2.31 13 10231 12.so.0.31[.0] + * 1.2.32beta01-02 13 10232 12.so.0.32[.0] + * 1.0.40rc01 10 10040 10.so.0.40[.0] + * 1.2.32rc01 13 10232 12.so.0.32[.0] + * 1.0.40 10 10040 10.so.0.40[.0] + * 1.2.32 13 10232 12.so.0.32[.0] + * 1.2.33beta01-02 13 10233 12.so.0.33[.0] + * 1.2.33rc01-02 13 10233 12.so.0.33[.0] + * 1.0.41rc01 10 10041 10.so.0.41[.0] + * 1.2.33 13 10233 12.so.0.33[.0] + * 1.0.41 10 10041 10.so.0.41[.0] + * 1.2.34beta01-07 13 10234 12.so.0.34[.0] + * 1.0.42rc01 10 10042 10.so.0.42[.0] + * 1.2.34rc01 13 10234 12.so.0.34[.0] + * 1.0.42 10 10042 10.so.0.42[.0] + * 1.2.34 13 10234 12.so.0.34[.0] + * 1.2.35beta01-03 13 10235 12.so.0.35[.0] + * 1.0.43rc01-02 10 10043 10.so.0.43[.0] + * 1.2.35rc01-02 13 10235 12.so.0.35[.0] + * 1.0.43 10 10043 10.so.0.43[.0] + * 1.2.35 13 10235 12.so.0.35[.0] * * Henceforth the source version will match the shared-library major * and minor numbers; the shared-library major version number will be *************** *** 231,237 **** * If you modify libpng you may insert additional notices immediately following * this sentence. * ! * libpng versions 1.2.6, August 15, 2004, through 1.2.31, August 21, 2008, are * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: --- 251,257 ---- * If you modify libpng you may insert additional notices immediately following * this sentence. * ! * libpng versions 1.2.6, August 15, 2004, through 1.2.35, February 14, 2009, are * Copyright (c) 2004, 2006-2008 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.2.5 * with the following individual added to the list of Contributing Authors: *************** *** 343,355 **** * Y2K compliance in libpng: * ========================= * ! * August 21, 2008 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and ! * upward through 1.2.31 are Y2K compliant. It is my belief that earlier * versions were also Y2K compliant. * * Libpng only has three year fields. One is a 2-byte unsigned integer --- 363,375 ---- * Y2K compliance in libpng: * ========================= * ! * February 14, 2009 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. * * This is your unofficial assurance that libpng from version 0.71 and ! * upward through 1.2.35 are Y2K compliant. It is my belief that earlier * versions were also Y2K compliant. * * Libpng only has three year fields. One is a 2-byte unsigned integer *************** *** 405,413 **** */ /* Version information for png.h - this should match the version in png.c */ ! #define PNG_LIBPNG_VER_STRING "1.2.31" #define PNG_HEADER_VERSION_STRING \ ! " libpng version 1.2.31 - August 21, 2008\n" #define PNG_LIBPNG_VER_SONUM 0 #define PNG_LIBPNG_VER_DLLNUM 13 --- 425,433 ---- */ /* Version information for png.h - this should match the version in png.c */ ! #define PNG_LIBPNG_VER_STRING "1.2.35" #define PNG_HEADER_VERSION_STRING \ ! " libpng version 1.2.35 - February 14, 2009\n" #define PNG_LIBPNG_VER_SONUM 0 #define PNG_LIBPNG_VER_DLLNUM 13 *************** *** 415,421 **** /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 2 ! #define PNG_LIBPNG_VER_RELEASE 31 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ --- 435,441 ---- /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 2 ! #define PNG_LIBPNG_VER_RELEASE 35 /* This should match the numeric part of the final component of * PNG_LIBPNG_VER_STRING, omitting any leading zero: */ *************** *** 443,449 **** * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ ! #define PNG_LIBPNG_VER 10231 /* 1.2.31 */ #ifndef PNG_VERSION_INFO_ONLY /* include the compression library's header */ --- 463,469 ---- * Versions 0.7 through 1.0.0 were in the range 0 to 100 here (only * version 1.0.0 was mis-numbered 100 instead of 10000). From * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release */ ! #define PNG_LIBPNG_VER 10235 /* 1.2.35 */ #ifndef PNG_VERSION_INFO_ONLY /* include the compression library's header */ *************** *** 1144,1150 **** #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ ! #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 --- 1164,1173 ---- #define PNG_TRANSFORM_SWAP_ALPHA 0x0100 /* read and write */ #define PNG_TRANSFORM_SWAP_ENDIAN 0x0200 /* read and write */ #define PNG_TRANSFORM_INVERT_ALPHA 0x0400 /* read and write */ ! #define PNG_TRANSFORM_STRIP_FILLER 0x0800 /* WRITE only, deprecated */ ! /* Added to libpng-1.2.34 */ ! #define PNG_TRANSFORM_STRIP_FILLER_BEFORE 0x0800 /* WRITE only */ ! #define PNG_TRANSFORM_STRIP_FILLER_AFTER 0x1000 /* WRITE only */ /* Flags for MNG supported features */ #define PNG_FLAG_MNG_EMPTY_PLTE 0x01 *************** *** 1464,1470 **** /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ ! typedef png_structp version_1_2_31; typedef png_struct FAR * FAR * png_structpp; --- 1487,1493 ---- /* This triggers a compiler error in png.c, if png.c and png.h * do not agree upon the version number. */ ! typedef png_structp version_1_2_35; typedef png_struct FAR * FAR * png_structpp; *************** *** 2516,2548 **** #if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) #include #if (PNG_DEBUG > 1) ! #define png_debug(l,m) _RPT0(_CRT_WARN,m) ! #define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m,p1) ! #define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m,p1,p2) #endif #else /* PNG_DEBUG_FILE || !_MSC_VER */ #ifndef PNG_DEBUG_FILE #define PNG_DEBUG_FILE stderr #endif /* PNG_DEBUG_FILE */ #if (PNG_DEBUG > 1) #define png_debug(l,m) \ { \ int num_tabs=l; \ ! fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ } #define png_debug1(l,m,p1) \ { \ int num_tabs=l; \ ! fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ } #define png_debug2(l,m,p1,p2) \ { \ int num_tabs=l; \ ! fprintf(PNG_DEBUG_FILE,"%s"m,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ } #endif /* (PNG_DEBUG > 1) */ #endif /* _MSC_VER */ #endif /* (PNG_DEBUG > 0) */ --- 2539,2618 ---- #if !defined(PNG_DEBUG_FILE) && defined(_MSC_VER) #include #if (PNG_DEBUG > 1) ! #ifndef _DEBUG ! # define _DEBUG ! #endif ! #ifndef png_debug ! #define png_debug(l,m) _RPT0(_CRT_WARN,m PNG_STRING_NEWLINE) ! #endif ! #ifndef png_debug1 ! #define png_debug1(l,m,p1) _RPT1(_CRT_WARN,m PNG_STRING_NEWLINE,p1) ! #endif ! #ifndef png_debug2 ! #define png_debug2(l,m,p1,p2) _RPT2(_CRT_WARN,m PNG_STRING_NEWLINE,p1,p2) ! #endif #endif #else /* PNG_DEBUG_FILE || !_MSC_VER */ #ifndef PNG_DEBUG_FILE #define PNG_DEBUG_FILE stderr #endif /* PNG_DEBUG_FILE */ #if (PNG_DEBUG > 1) + #ifndef png_debug + /* Note: ["%s"m PNG_STRING_NEWLINE] probably does not work on + * non-ISO compilers */ + #ifdef __STDC__ #define png_debug(l,m) \ { \ int num_tabs=l; \ ! fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":"")))); \ } + #endif + #ifndef png_debug1 #define png_debug1(l,m,p1) \ { \ int num_tabs=l; \ ! fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1); \ } + #endif + #ifndef png_debug2 #define png_debug2(l,m,p1,p2) \ { \ int num_tabs=l; \ ! fprintf(PNG_DEBUG_FILE,"%s"m PNG_STRING_NEWLINE,(num_tabs==1 ? "\t" : \ (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))),p1,p2); \ } + #endif + #else /* __STDC __ */ + #ifndef png_debug + #define png_debug(l,m) \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format); + #endif + #ifndef png_debug1 + #define png_debug1(l,m,p1) \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1); + #endif + #ifndef png_debug2 + #define png_debug2(l,m,p1,p2) \ + int num_tabs=l; \ + char format[256]; \ + snprintf(format,256,"%s%s%s",(num_tabs==1 ? "\t" : \ + (num_tabs==2 ? "\t\t":(num_tabs>2 ? "\t\t\t":""))), \ + m,PNG_STRING_NEWLINE); \ + fprintf(PNG_DEBUG_FILE,format,p1,p2); + #endif + #endif /* __STDC __ */ #endif /* (PNG_DEBUG > 1) */ #endif /* _MSC_VER */ #endif /* (PNG_DEBUG > 0) */ *************** *** 3573,3578 **** --- 3643,3657 ---- /* Read the chunk header (length + type name) */ PNG_EXTERN png_uint_32 png_read_chunk_header PNGARG((png_structp png_ptr)); + + /* Added at libpng version 1.2.34 */ + #if defined(PNG_cHRM_SUPPORTED) + PNG_EXTERN int png_check_cHRM_fixed PNGARG((png_structp png_ptr, + png_fixed_point int_white_x, png_fixed_point int_white_y, + png_fixed_point int_red_x, png_fixed_point int_red_y, png_fixed_point + int_green_x, png_fixed_point int_green_y, png_fixed_point int_blue_x, + png_fixed_point int_blue_y)); + #endif /* Maintainer: Put new private prototypes here ^ and in libpngpf.3 */ Index: pngconf.h =================================================================== RCS file: /cvs/mushclient/pngconf.h,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngconf.h 25 Aug 2008 02:47:14 -0000 1.1 --- pngconf.h 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,9 **** /* pngconf.h - machine configurable file for libpng * ! * libpng version 1.2.31 - August 21, 2008 * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ --- 1,9 ---- /* pngconf.h - machine configurable file for libpng * ! * libpng version 1.2.35 - February 14, 2009 * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) */ *************** *** 233,238 **** --- 233,240 ---- # include /* Console I/O functions are not supported on WindowsCE */ # define PNG_NO_CONSOLE_IO + /* abort() may not be supported on some/all Windows CE platforms */ + # define PNG_ABORT() exit(-1) # ifdef PNG_DEBUG # undef PNG_DEBUG # endif *************** *** 796,801 **** --- 798,809 ---- #endif #ifndef PNG_USER_HEIGHT_MAX # define PNG_USER_HEIGHT_MAX 1000000L + #endif + + + /* Added at libpng-1.2.34 and 1.4.0 */ + #ifndef PNG_STRING_NEWLINE + #define PNG_STRING_NEWLINE "\n" #endif /* These are currently experimental features, define them if you want */ Index: pngerror.c =================================================================== RCS file: /cvs/mushclient/pngerror.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngerror.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngerror.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,7 **** /* pngerror.c - stub functions for i/o and memory allocation * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) --- 1,7 ---- /* pngerror.c - stub functions for i/o and memory allocation * ! * Last changed in libpng 1.2.34 [December 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) *************** *** 116,124 **** break; } } - if (png_ptr != NULL && png_ptr->warning_fn != NULL) - (*(png_ptr->warning_fn))(png_ptr, warning_message + offset); } else png_default_warning(png_ptr, warning_message + offset); } --- 116,124 ---- break; } } } + if (png_ptr != NULL && png_ptr->warning_fn != NULL) + (*(png_ptr->warning_fn))(png_ptr, warning_message + offset); else png_default_warning(png_ptr, warning_message + offset); } Index: pngget.c =================================================================== RCS file: /cvs/mushclient/pngget.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngget.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngget.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 120,126 **** #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_x_pixels_per_meter"); if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) return (0); else return (info_ptr->x_pixels_per_unit); --- 120,126 ---- #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function", "png_get_x_pixels_per_meter"); if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) return (0); else return (info_ptr->x_pixels_per_unit); *************** *** 138,144 **** #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_y_pixels_per_meter"); if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) return (0); else return (info_ptr->y_pixels_per_unit); --- 138,144 ---- #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function", "png_get_y_pixels_per_meter"); if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER) return (0); else return (info_ptr->y_pixels_per_unit); *************** *** 156,162 **** #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_pixels_per_meter"); if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER || info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) return (0); --- 156,162 ---- #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter"); if (info_ptr->phys_unit_type != PNG_RESOLUTION_METER || info_ptr->x_pixels_per_unit != info_ptr->y_pixels_per_unit) return (0); *************** *** 176,182 **** #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_aspect_ratio"); if (info_ptr->x_pixels_per_unit == 0) return ((float)0.0); else --- 176,182 ---- #if defined(PNG_pHYs_SUPPORTED) if (info_ptr->valid & PNG_INFO_pHYs) { ! png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio"); if (info_ptr->x_pixels_per_unit == 0) return ((float)0.0); else *************** *** 197,203 **** #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) return (0); else return (info_ptr->x_offset); --- 197,203 ---- #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) return (0); else return (info_ptr->x_offset); *************** *** 215,221 **** #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) return (0); else return (info_ptr->y_offset); --- 215,221 ---- #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_MICROMETER) return (0); else return (info_ptr->y_offset); *************** *** 233,239 **** #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_x_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) return (0); else return (info_ptr->x_offset); --- 233,239 ---- #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) return (0); else return (info_ptr->x_offset); *************** *** 251,257 **** #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function\n", "png_get_y_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) return (0); else return (info_ptr->y_offset); --- 251,257 ---- #if defined(PNG_oFFs_SUPPORTED) if (info_ptr->valid & PNG_INFO_oFFs) { ! png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns"); if (info_ptr->offset_unit_type != PNG_OFFSET_PIXEL) return (0); else return (info_ptr->y_offset); *************** *** 307,313 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) { ! png_debug1(1, "in %s retrieval function\n", "pHYs"); if (res_x != NULL) { *res_x = info_ptr->x_pixels_per_unit; --- 307,313 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) { ! png_debug1(1, "in %s retrieval function", "pHYs"); if (res_x != NULL) { *res_x = info_ptr->x_pixels_per_unit; *************** *** 364,370 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) && background != NULL) { ! png_debug1(1, "in %s retrieval function\n", "bKGD"); *background = &(info_ptr->background); return (PNG_INFO_bKGD); } --- 364,370 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_bKGD) && background != NULL) { ! png_debug1(1, "in %s retrieval function", "bKGD"); *background = &(info_ptr->background); return (PNG_INFO_bKGD); } *************** *** 381,387 **** { if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) { ! png_debug1(1, "in %s retrieval function\n", "cHRM"); if (white_x != NULL) *white_x = (double)info_ptr->x_white; if (white_y != NULL) --- 381,387 ---- { if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) { ! png_debug1(1, "in %s retrieval function", "cHRM"); if (white_x != NULL) *white_x = (double)info_ptr->x_white; if (white_y != NULL) *************** *** 412,418 **** { if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) { ! png_debug1(1, "in %s retrieval function\n", "cHRM"); if (white_x != NULL) *white_x = info_ptr->int_x_white; if (white_y != NULL) --- 412,418 ---- { if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_cHRM)) { ! png_debug1(1, "in %s retrieval function", "cHRM"); if (white_x != NULL) *white_x = info_ptr->int_x_white; if (white_y != NULL) *************** *** 444,450 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) && file_gamma != NULL) { ! png_debug1(1, "in %s retrieval function\n", "gAMA"); *file_gamma = (double)info_ptr->gamma; return (PNG_INFO_gAMA); } --- 444,450 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) && file_gamma != NULL) { ! png_debug1(1, "in %s retrieval function", "gAMA"); *file_gamma = (double)info_ptr->gamma; return (PNG_INFO_gAMA); } *************** *** 459,465 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) && int_file_gamma != NULL) { ! png_debug1(1, "in %s retrieval function\n", "gAMA"); *int_file_gamma = info_ptr->int_gamma; return (PNG_INFO_gAMA); } --- 459,465 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_gAMA) && int_file_gamma != NULL) { ! png_debug1(1, "in %s retrieval function", "gAMA"); *int_file_gamma = info_ptr->int_gamma; return (PNG_INFO_gAMA); } *************** *** 475,481 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) && file_srgb_intent != NULL) { ! png_debug1(1, "in %s retrieval function\n", "sRGB"); *file_srgb_intent = (int)info_ptr->srgb_intent; return (PNG_INFO_sRGB); } --- 475,481 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sRGB) && file_srgb_intent != NULL) { ! png_debug1(1, "in %s retrieval function", "sRGB"); *file_srgb_intent = (int)info_ptr->srgb_intent; return (PNG_INFO_sRGB); } *************** *** 492,498 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) && name != NULL && profile != NULL && proflen != NULL) { ! png_debug1(1, "in %s retrieval function\n", "iCCP"); *name = info_ptr->iccp_name; *profile = info_ptr->iccp_profile; /* compression_type is a dummy so the API won't have to change --- 492,498 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_iCCP) && name != NULL && profile != NULL && proflen != NULL) { ! png_debug1(1, "in %s retrieval function", "iCCP"); *name = info_ptr->iccp_name; *profile = info_ptr->iccp_profile; /* compression_type is a dummy so the API won't have to change *************** *** 526,532 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) && hist != NULL) { ! png_debug1(1, "in %s retrieval function\n", "hIST"); *hist = info_ptr->hist; return (PNG_INFO_hIST); } --- 526,532 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_hIST) && hist != NULL) { ! png_debug1(1, "in %s retrieval function", "hIST"); *hist = info_ptr->hist; return (PNG_INFO_hIST); } *************** *** 544,550 **** if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL && bit_depth != NULL && color_type != NULL) { ! png_debug1(1, "in %s retrieval function\n", "IHDR"); *width = info_ptr->width; *height = info_ptr->height; *bit_depth = info_ptr->bit_depth; --- 544,550 ---- if (png_ptr != NULL && info_ptr != NULL && width != NULL && height != NULL && bit_depth != NULL && color_type != NULL) { ! png_debug1(1, "in %s retrieval function", "IHDR"); *width = info_ptr->width; *height = info_ptr->height; *bit_depth = info_ptr->bit_depth; *************** *** 588,594 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) && offset_x != NULL && offset_y != NULL && unit_type != NULL) { ! png_debug1(1, "in %s retrieval function\n", "oFFs"); *offset_x = info_ptr->x_offset; *offset_y = info_ptr->y_offset; *unit_type = (int)info_ptr->offset_unit_type; --- 588,594 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_oFFs) && offset_x != NULL && offset_y != NULL && unit_type != NULL) { ! png_debug1(1, "in %s retrieval function", "oFFs"); *offset_x = info_ptr->x_offset; *offset_y = info_ptr->y_offset; *unit_type = (int)info_ptr->offset_unit_type; *************** *** 608,614 **** && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && nparams != NULL && units != NULL && params != NULL) { ! png_debug1(1, "in %s retrieval function\n", "pCAL"); *purpose = info_ptr->pcal_purpose; *X0 = info_ptr->pcal_X0; *X1 = info_ptr->pcal_X1; --- 608,614 ---- && purpose != NULL && X0 != NULL && X1 != NULL && type != NULL && nparams != NULL && units != NULL && params != NULL) { ! png_debug1(1, "in %s retrieval function", "pCAL"); *purpose = info_ptr->pcal_purpose; *X0 = info_ptr->pcal_X0; *X1 = info_ptr->pcal_X1; *************** *** 668,674 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) { ! png_debug1(1, "in %s retrieval function\n", "pHYs"); if (res_x != NULL) { *res_x = info_ptr->x_pixels_per_unit; --- 668,674 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_pHYs)) { ! png_debug1(1, "in %s retrieval function", "pHYs"); if (res_x != NULL) { *res_x = info_ptr->x_pixels_per_unit; *************** *** 696,705 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) && palette != NULL) { ! png_debug1(1, "in %s retrieval function\n", "PLTE"); *palette = info_ptr->palette; *num_palette = info_ptr->num_palette; ! png_debug1(3, "num_palette = %d\n", *num_palette); return (PNG_INFO_PLTE); } return (0); --- 696,705 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_PLTE) && palette != NULL) { ! png_debug1(1, "in %s retrieval function", "PLTE"); *palette = info_ptr->palette; *num_palette = info_ptr->num_palette; ! png_debug1(3, "num_palette = %d", *num_palette); return (PNG_INFO_PLTE); } return (0); *************** *** 712,718 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) && sig_bit != NULL) { ! png_debug1(1, "in %s retrieval function\n", "sBIT"); *sig_bit = &(info_ptr->sig_bit); return (PNG_INFO_sBIT); } --- 712,718 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_sBIT) && sig_bit != NULL) { ! png_debug1(1, "in %s retrieval function", "sBIT"); *sig_bit = &(info_ptr->sig_bit); return (PNG_INFO_sBIT); } *************** *** 727,733 **** { if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) { ! png_debug1(1, "in %s retrieval function\n", (png_ptr->chunk_name[0] == '\0' ? "text" : (png_const_charp)png_ptr->chunk_name)); if (text_ptr != NULL) --- 727,733 ---- { if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0) { ! png_debug1(1, "in %s retrieval function", (png_ptr->chunk_name[0] == '\0' ? "text" : (png_const_charp)png_ptr->chunk_name)); if (text_ptr != NULL) *************** *** 749,755 **** if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) && mod_time != NULL) { ! png_debug1(1, "in %s retrieval function\n", "tIME"); *mod_time = &(info_ptr->mod_time); return (PNG_INFO_tIME); } --- 749,755 ---- if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tIME) && mod_time != NULL) { ! png_debug1(1, "in %s retrieval function", "tIME"); *mod_time = &(info_ptr->mod_time); return (PNG_INFO_tIME); } *************** *** 765,771 **** png_uint_32 retval = 0; if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) { ! png_debug1(1, "in %s retrieval function\n", "tRNS"); if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { if (trans != NULL) --- 765,771 ---- png_uint_32 retval = 0; if (png_ptr != NULL && info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS)) { ! png_debug1(1, "in %s retrieval function", "tRNS"); if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) { if (trans != NULL) *************** *** 883,889 **** #endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED ! /* these functions were added to libpng 1.2.6 */ png_uint_32 PNGAPI png_get_user_width_max (png_structp png_ptr) { --- 883,889 ---- #endif /* ?PNG_ASSEMBLER_CODE_SUPPORTED */ #ifdef PNG_SET_USER_LIMITS_SUPPORTED ! /* These functions were added to libpng 1.2.6 */ png_uint_32 PNGAPI png_get_user_width_max (png_structp png_ptr) { Index: pngpread.c =================================================================== RCS file: /cvs/mushclient/pngpread.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngpread.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngpread.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,7 **** /* pngpread.c - read a png file in push mode * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) --- 1,7 ---- /* pngpread.c - read a png file in push mode * ! * Last changed in libpng 1.2.32 [September 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) *************** *** 1279,1285 **** tmp = text; text = (png_charp)png_malloc(png_ptr, text_size + (png_uint_32)(png_ptr->zbuf_size ! - png_ptr->zstream.avail_out)); png_memcpy(text, tmp, text_size); png_free(png_ptr, tmp); png_memcpy(text + text_size, png_ptr->zbuf, --- 1279,1285 ---- tmp = text; text = (png_charp)png_malloc(png_ptr, text_size + (png_uint_32)(png_ptr->zbuf_size ! - png_ptr->zstream.avail_out + 1)); png_memcpy(text, tmp, text_size); png_free(png_ptr, tmp); png_memcpy(text + text_size, png_ptr->zbuf, Index: pngread.c =================================================================== RCS file: /cvs/mushclient/pngread.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngread.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngread.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,9 **** /* pngread.c - read a PNG file * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * --- 1,9 ---- /* pngread.c - read a PNG file * ! * Last changed in libpng 1.2.35 [February 14, 2009] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * *************** *** 47,53 **** int i; ! png_debug(1, "in png_create_read_struct\n"); #ifdef PNG_USER_MEM_SUPPORTED png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); --- 47,53 ---- int i; ! png_debug(1, "in png_create_read_struct"); #ifdef PNG_USER_MEM_SUPPORTED png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); *************** *** 263,269 **** } } while (png_libpng_ver[i++]); ! png_debug(1, "in png_read_init_3\n"); #ifdef PNG_SETJMP_SUPPORTED /* save jump buffer and error functions */ --- 263,269 ---- } } while (png_libpng_ver[i++]); ! png_debug(1, "in png_read_init_3"); #ifdef PNG_SETJMP_SUPPORTED /* save jump buffer and error functions */ *************** *** 327,333 **** png_read_info(png_structp png_ptr, png_infop info_ptr) { if (png_ptr == NULL || info_ptr == NULL) return; ! png_debug(1, "in png_read_info\n"); /* If we haven't checked all of the PNG signature bytes, do so now. */ if (png_ptr->sig_bytes < 8) { --- 327,333 ---- png_read_info(png_structp png_ptr, png_infop info_ptr) { if (png_ptr == NULL || info_ptr == NULL) return; ! png_debug(1, "in png_read_info"); /* If we haven't checked all of the PNG signature bytes, do so now. */ if (png_ptr->sig_bytes < 8) { *************** *** 533,539 **** void PNGAPI png_read_update_info(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_read_update_info\n"); if (png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); --- 533,539 ---- void PNGAPI png_read_update_info(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_read_update_info"); if (png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); *************** *** 552,558 **** void PNGAPI png_start_read_image(png_structp png_ptr) { ! png_debug(1, "in png_start_read_image\n"); if (png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); --- 552,558 ---- void PNGAPI png_start_read_image(png_structp png_ptr) { ! png_debug(1, "in png_start_read_image"); if (png_ptr == NULL) return; if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); *************** *** 571,577 **** #endif int ret; if (png_ptr == NULL) return; ! png_debug2(1, "in png_read_row (row %lu, pass %d)\n", png_ptr->row_number, png_ptr->pass); if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); --- 571,577 ---- #endif int ret; if (png_ptr == NULL) return; ! png_debug2(1, "in png_read_row (row %lu, pass %d)", png_ptr->row_number, png_ptr->pass); if (!(png_ptr->flags & PNG_FLAG_ROW_INIT)) png_read_start_row(png_ptr); *************** *** 822,828 **** png_bytepp rp; png_bytepp dp; ! png_debug(1, "in png_read_rows\n"); if (png_ptr == NULL) return; rp = row; dp = display_row; --- 822,828 ---- png_bytepp rp; png_bytepp dp; ! png_debug(1, "in png_read_rows"); if (png_ptr == NULL) return; rp = row; dp = display_row; *************** *** 871,877 **** int pass, j; png_bytepp rp; ! png_debug(1, "in png_read_image\n"); if (png_ptr == NULL) return; #ifdef PNG_READ_INTERLACING_SUPPORTED --- 871,877 ---- int pass, j; png_bytepp rp; ! png_debug(1, "in png_read_image"); if (png_ptr == NULL) return; #ifdef PNG_READ_INTERLACING_SUPPORTED *************** *** 907,913 **** void PNGAPI png_read_end(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_read_end\n"); if (png_ptr == NULL) return; png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ --- 907,913 ---- void PNGAPI png_read_end(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_read_end"); if (png_ptr == NULL) return; png_crc_finish(png_ptr, 0); /* Finish off CRC from last IDAT chunk */ *************** *** 1087,1093 **** png_voidp mem_ptr = NULL; #endif ! png_debug(1, "in png_destroy_read_struct\n"); if (png_ptr_ptr != NULL) png_ptr = *png_ptr_ptr; if (png_ptr == NULL) --- 1087,1093 ---- png_voidp mem_ptr = NULL; #endif ! png_debug(1, "in png_destroy_read_struct"); if (png_ptr_ptr != NULL) png_ptr = *png_ptr_ptr; if (png_ptr == NULL) *************** *** 1161,1167 **** png_free_ptr free_fn; #endif ! png_debug(1, "in png_read_destroy\n"); if (info_ptr != NULL) png_info_destroy(png_ptr, info_ptr); --- 1161,1167 ---- png_free_ptr free_fn; #endif ! png_debug(1, "in png_read_destroy"); if (info_ptr != NULL) png_info_destroy(png_ptr, info_ptr); *************** *** 1437,1447 **** #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_ROWS; #endif for (row = 0; row < (int)info_ptr->height; row++) - { info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); - } } png_read_image(png_ptr, info_ptr->row_pointers); --- 1437,1447 ---- #ifdef PNG_FREE_ME_SUPPORTED info_ptr->free_me |= PNG_FREE_ROWS; #endif + png_memset(info_ptr->row_pointers, 0, info_ptr->height + * png_sizeof(png_bytep)); for (row = 0; row < (int)info_ptr->height; row++) info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr, png_get_rowbytes(png_ptr, info_ptr)); } png_read_image(png_ptr, info_ptr->row_pointers); Index: pngrio.c =================================================================== RCS file: /cvs/mushclient/pngrio.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngrio.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngrio.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 27,33 **** void /* PRIVATE */ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { ! png_debug1(4, "reading %d bytes\n", (int)length); if (png_ptr->read_data_fn != NULL) (*(png_ptr->read_data_fn))(png_ptr, data, length); else --- 27,33 ---- void /* PRIVATE */ png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) { ! png_debug1(4, "reading %d bytes", (int)length); if (png_ptr->read_data_fn != NULL) (*(png_ptr->read_data_fn))(png_ptr, data, length); else Index: pngrtran.c =================================================================== RCS file: /cvs/mushclient/pngrtran.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngrtran.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngrtran.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,9 **** /* pngrtran.c - transforms the data in a row for PNG readers * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * --- 1,9 ---- /* pngrtran.c - transforms the data in a row for PNG readers * ! * Last changed in libpng 1.2.35 [February 14, 2009] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * *************** *** 21,27 **** void PNGAPI png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) { ! png_debug(1, "in png_set_crc_action\n"); /* Tell libpng how we react to CRC errors in critical chunks */ if (png_ptr == NULL) return; switch (crit_action) --- 21,27 ---- void PNGAPI png_set_crc_action(png_structp png_ptr, int crit_action, int ancil_action) { ! png_debug(1, "in png_set_crc_action"); /* Tell libpng how we react to CRC errors in critical chunks */ if (png_ptr == NULL) return; switch (crit_action) *************** *** 80,86 **** png_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma) { ! png_debug(1, "in png_set_background\n"); if (png_ptr == NULL) return; if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) { --- 80,86 ---- png_color_16p background_color, int background_gamma_code, int need_expand, double background_gamma) { ! png_debug(1, "in png_set_background"); if (png_ptr == NULL) return; if (background_gamma_code == PNG_BACKGROUND_GAMMA_UNKNOWN) { *************** *** 102,108 **** void PNGAPI png_set_strip_16(png_structp png_ptr) { ! png_debug(1, "in png_set_strip_16\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_16_TO_8; } --- 102,108 ---- void PNGAPI png_set_strip_16(png_structp png_ptr) { ! png_debug(1, "in png_set_strip_16"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_16_TO_8; } *************** *** 112,118 **** void PNGAPI png_set_strip_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_strip_alpha\n"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_STRIP_ALPHA; } --- 112,118 ---- void PNGAPI png_set_strip_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_strip_alpha"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_STRIP_ALPHA; } *************** *** 142,148 **** int num_palette, int maximum_colors, png_uint_16p histogram, int full_dither) { ! png_debug(1, "in png_set_dither\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_DITHER; --- 142,148 ---- int num_palette, int maximum_colors, png_uint_16p histogram, int full_dither) { ! png_debug(1, "in png_set_dither"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_DITHER; *************** *** 309,317 **** hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 * png_sizeof(png_dsortp))); ! for (i = 0; i < 769; i++) ! hash[i] = NULL; ! /* png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); */ num_new_palette = num_palette; --- 309,315 ---- hash = (png_dsortpp)png_malloc(png_ptr, (png_uint_32)(769 * png_sizeof(png_dsortp))); ! png_memset(hash, 0, 769 * png_sizeof(png_dsortp)); num_new_palette = num_palette; *************** *** 526,532 **** void PNGAPI png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) { ! png_debug(1, "in png_set_gamma\n"); if (png_ptr == NULL) return; if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || --- 524,530 ---- void PNGAPI png_set_gamma(png_structp png_ptr, double scrn_gamma, double file_gamma) { ! png_debug(1, "in png_set_gamma"); if (png_ptr == NULL) return; if ((fabs(scrn_gamma * file_gamma - 1.0) > PNG_GAMMA_THRESHOLD) || (png_ptr->color_type & PNG_COLOR_MASK_ALPHA) || *************** *** 545,551 **** void PNGAPI png_set_expand(png_structp png_ptr) { ! png_debug(1, "in png_set_expand\n"); if (png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; --- 543,549 ---- void PNGAPI png_set_expand(png_structp png_ptr) { ! png_debug(1, "in png_set_expand"); if (png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; *************** *** 572,578 **** void PNGAPI png_set_palette_to_rgb(png_structp png_ptr) { ! png_debug(1, "in png_set_palette_to_rgb\n"); if (png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; --- 570,576 ---- void PNGAPI png_set_palette_to_rgb(png_structp png_ptr) { ! png_debug(1, "in png_set_palette_to_rgb"); if (png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; *************** *** 583,589 **** void PNGAPI png_set_expand_gray_1_2_4_to_8(png_structp png_ptr) { ! png_debug(1, "in png_set_expand_gray_1_2_4_to_8\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_EXPAND; png_ptr->flags &= ~PNG_FLAG_ROW_INIT; --- 581,587 ---- void PNGAPI png_set_expand_gray_1_2_4_to_8(png_structp png_ptr) { ! png_debug(1, "in png_set_expand_gray_1_2_4_to_8"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_EXPAND; png_ptr->flags &= ~PNG_FLAG_ROW_INIT; *************** *** 596,602 **** void PNGAPI png_set_gray_1_2_4_to_8(png_structp png_ptr) { ! png_debug(1, "in png_set_gray_1_2_4_to_8\n"); if (png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); } --- 594,600 ---- void PNGAPI png_set_gray_1_2_4_to_8(png_structp png_ptr) { ! png_debug(1, "in png_set_gray_1_2_4_to_8"); if (png_ptr == NULL) return; png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); } *************** *** 607,613 **** void PNGAPI png_set_tRNS_to_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_tRNS_to_alpha\n"); png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; } --- 605,611 ---- void PNGAPI png_set_tRNS_to_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_tRNS_to_alpha"); png_ptr->transformations |= (PNG_EXPAND | PNG_EXPAND_tRNS); png_ptr->flags &= ~PNG_FLAG_ROW_INIT; } *************** *** 617,623 **** void PNGAPI png_set_gray_to_rgb(png_structp png_ptr) { ! png_debug(1, "in png_set_gray_to_rgb\n"); png_ptr->transformations |= PNG_GRAY_TO_RGB; png_ptr->flags &= ~PNG_FLAG_ROW_INIT; } --- 615,621 ---- void PNGAPI png_set_gray_to_rgb(png_structp png_ptr) { ! png_debug(1, "in png_set_gray_to_rgb"); png_ptr->transformations |= PNG_GRAY_TO_RGB; png_ptr->flags &= ~PNG_FLAG_ROW_INIT; } *************** *** 644,650 **** png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, png_fixed_point red, png_fixed_point green) { ! png_debug(1, "in png_set_rgb_to_gray\n"); if (png_ptr == NULL) return; switch(error_action) { --- 642,648 ---- png_set_rgb_to_gray_fixed(png_structp png_ptr, int error_action, png_fixed_point red, png_fixed_point green) { ! png_debug(1, "in png_set_rgb_to_gray"); if (png_ptr == NULL) return; switch(error_action) { *************** *** 684,690 **** } png_ptr->rgb_to_gray_red_coeff = red_int; png_ptr->rgb_to_gray_green_coeff = green_int; ! png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768 - red_int - green_int); } } --- 682,688 ---- } png_ptr->rgb_to_gray_red_coeff = red_int; png_ptr->rgb_to_gray_green_coeff = green_int; ! png_ptr->rgb_to_gray_blue_coeff = (png_uint_16)(32768 - red_int - green_int); } } *************** *** 697,703 **** png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr read_user_transform_fn) { ! png_debug(1, "in png_set_read_user_transform_fn\n"); if (png_ptr == NULL) return; #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) png_ptr->transformations |= PNG_USER_TRANSFORM; --- 695,701 ---- png_set_read_user_transform_fn(png_structp png_ptr, png_user_transform_ptr read_user_transform_fn) { ! png_debug(1, "in png_set_read_user_transform_fn"); if (png_ptr == NULL) return; #if defined(PNG_READ_USER_TRANSFORM_SUPPORTED) png_ptr->transformations |= PNG_USER_TRANSFORM; *************** *** 717,723 **** void /* PRIVATE */ png_init_read_transformations(png_structp png_ptr) { ! png_debug(1, "in png_init_read_transformations\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (png_ptr != NULL) #endif --- 715,721 ---- void /* PRIVATE */ png_init_read_transformations(png_structp png_ptr) { ! png_debug(1, "in png_init_read_transformations"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (png_ptr != NULL) #endif *************** *** 1124,1130 **** void /* PRIVATE */ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_read_transform_info\n"); #if defined(PNG_READ_EXPAND_SUPPORTED) if (png_ptr->transformations & PNG_EXPAND) { --- 1122,1128 ---- void /* PRIVATE */ png_read_transform_info(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_read_transform_info"); #if defined(PNG_READ_EXPAND_SUPPORTED) if (png_ptr->transformations & PNG_EXPAND) { *************** *** 1268,1274 **** void /* PRIVATE */ png_do_read_transformations(png_structp png_ptr) { ! png_debug(1, "in png_do_read_transformations\n"); if (png_ptr->row_buf == NULL) { #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) --- 1266,1272 ---- void /* PRIVATE */ png_do_read_transformations(png_structp png_ptr) { ! png_debug(1, "in png_do_read_transformations"); if (png_ptr->row_buf == NULL) { #if !defined(PNG_NO_STDIO) && !defined(_WIN32_WCE) *************** *** 1329,1335 **** if (rgb_error) { png_ptr->rgb_to_gray_status=1; ! if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == PNG_RGB_TO_GRAY_WARN) png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == --- 1327,1333 ---- if (rgb_error) { png_ptr->rgb_to_gray_status=1; ! if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == PNG_RGB_TO_GRAY_WARN) png_warning(png_ptr, "png_do_rgb_to_gray found nongray pixel"); if ((png_ptr->transformations & PNG_RGB_TO_GRAY) == *************** *** 1514,1520 **** void /* PRIVATE */ png_do_unpack(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_unpack\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && row_info->bit_depth < 8) #else --- 1512,1518 ---- void /* PRIVATE */ png_do_unpack(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_unpack"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && row_info->bit_depth < 8) #else *************** *** 1604,1610 **** void /* PRIVATE */ png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits) { ! png_debug(1, "in png_do_unshift\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && sig_bits != NULL && --- 1602,1608 ---- void /* PRIVATE */ png_do_unshift(png_row_infop row_info, png_bytep row, png_color_8p sig_bits) { ! png_debug(1, "in png_do_unshift"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && sig_bits != NULL && *************** *** 1710,1716 **** void /* PRIVATE */ png_do_chop(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_chop\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && row_info->bit_depth == 16) #else --- 1708,1714 ---- void /* PRIVATE */ png_do_chop(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_chop"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && row_info->bit_depth == 16) #else *************** *** 1764,1770 **** void /* PRIVATE */ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_read_swap_alpha\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 1762,1768 ---- void /* PRIVATE */ png_do_read_swap_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_read_swap_alpha"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 1856,1862 **** void /* PRIVATE */ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_read_invert_alpha\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 1854,1860 ---- void /* PRIVATE */ png_do_read_invert_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_read_invert_alpha"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 1962,1968 **** png_byte hi_filler = (png_byte)((filler>>8) & 0xff); png_byte lo_filler = (png_byte)(filler & 0xff); ! png_debug(1, "in png_do_read_filler\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 1960,1966 ---- png_byte hi_filler = (png_byte)((filler>>8) & 0xff); png_byte lo_filler = (png_byte)(filler & 0xff); ! png_debug(1, "in png_do_read_filler"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 2134,2140 **** png_uint_32 i; png_uint_32 row_width = row_info->width; ! png_debug(1, "in png_do_gray_to_rgb\n"); if (row_info->bit_depth >= 8 && #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 2132,2138 ---- png_uint_32 i; png_uint_32 row_width = row_info->width; ! png_debug(1, "in png_do_gray_to_rgb"); if (row_info->bit_depth >= 8 && #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 2240,2246 **** png_uint_32 row_width = row_info->width; int rgb_error = 0; ! png_debug(1, "in png_do_rgb_to_gray\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 2238,2244 ---- png_uint_32 row_width = row_info->width; int rgb_error = 0; ! png_debug(1, "in png_do_rgb_to_gray"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 2478,2484 **** int i; int v; ! png_debug(1, "in png_do_build_grayscale_palette\n"); if (palette == NULL) return; --- 2476,2482 ---- int i; int v; ! png_debug(1, "in png_do_build_grayscale_palette"); if (palette == NULL) return; *************** *** 2520,2526 **** png_correct_palette(png_structp png_ptr, png_colorp palette, int num_palette) { ! png_debug(1, "in png_correct_palette\n"); #if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND)) --- 2518,2524 ---- png_correct_palette(png_structp png_ptr, png_colorp palette, int num_palette) { ! png_debug(1, "in png_correct_palette"); #if defined(PNG_READ_BACKGROUND_SUPPORTED) && \ defined(PNG_READ_GAMMA_SUPPORTED) && defined(PNG_FLOATING_POINT_SUPPORTED) if (png_ptr->transformations & (PNG_GAMMA | PNG_BACKGROUND)) *************** *** 2717,2723 **** png_uint_32 row_width=row_info->width; int shift; ! png_debug(1, "in png_do_background\n"); if (background != NULL && #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 2715,2721 ---- png_uint_32 row_width=row_info->width; int shift; ! png_debug(1, "in png_do_background"); if (background != NULL && #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 3399,3405 **** png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_gamma\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 3397,3403 ---- png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_gamma"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 3581,3587 **** png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_expand_palette\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 3579,3585 ---- png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_expand_palette"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 3724,3730 **** png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_expand\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 3722,3728 ---- png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_expand"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 3836,3842 **** dp = row + (row_info->rowbytes << 1) - 1; for (i = 0; i < row_width; i++) { ! if (*(sp - 1) == gray_high && *(sp) == gray_low) { *dp-- = 0; *dp-- = 0; --- 3834,3840 ---- dp = row + (row_info->rowbytes << 1) - 1; for (i = 0; i < row_width; i++) { ! if (*(sp - 1) == gray_high && *(sp) == gray_low) { *dp-- = 0; *dp-- = 0; *************** *** 3930,3936 **** png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_dither\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 3928,3934 ---- png_uint_32 i; png_uint_32 row_width=row_info->width; ! png_debug(1, "in png_do_dither"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 4025,4031 **** void /* PRIVATE */ png_build_gamma_table(png_structp png_ptr) { ! png_debug(1, "in png_build_gamma_table\n"); if (png_ptr->bit_depth <= 8) { --- 4023,4029 ---- void /* PRIVATE */ png_build_gamma_table(png_structp png_ptr) { ! png_debug(1, "in png_build_gamma_table"); if (png_ptr->bit_depth <= 8) { *************** *** 4133,4138 **** --- 4131,4138 ---- double fin, fout; png_uint_32 last, max; + png_memset(png_ptr->gamma_16_table, 0, num * png_sizeof(png_uint_16p)); + for (i = 0; i < num; i++) { png_ptr->gamma_16_table[i] = (png_uint_16p)png_malloc(png_ptr, *************** *** 4188,4193 **** --- 4188,4195 ---- png_ptr->gamma_16_to_1 = (png_uint_16pp)png_malloc(png_ptr, (png_uint_32)(num * png_sizeof(png_uint_16p ))); + png_memset(png_ptr->gamma_16_to_1, 0, num * png_sizeof(png_uint_16p)); + for (i = 0; i < num; i++) { png_ptr->gamma_16_to_1[i] = (png_uint_16p)png_malloc(png_ptr, *************** *** 4211,4216 **** --- 4213,4221 ---- png_ptr->gamma_16_from_1 = (png_uint_16pp)png_malloc(png_ptr, (png_uint_32)(num * png_sizeof(png_uint_16p))); + png_memset(png_ptr->gamma_16_from_1, 0, + num * png_sizeof(png_uint_16p)); + for (i = 0; i < num; i++) { png_ptr->gamma_16_from_1[i] = (png_uint_16p)png_malloc(png_ptr, *************** *** 4238,4244 **** void /* PRIVATE */ png_do_read_intrapixel(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_read_intrapixel\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 4243,4249 ---- void /* PRIVATE */ png_do_read_intrapixel(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_read_intrapixel"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && Index: pngrutil.c =================================================================== RCS file: /cvs/mushclient/pngrutil.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngrutil.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngrutil.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,7 **** /* pngrutil.c - utilities to read a PNG file * ! * Last changed in libpng 1.2.31 [August 21, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) --- 1,7 ---- /* pngrutil.c - utilities to read a PNG file * ! * Last changed in libpng 1.2.34 [December 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) *************** *** 115,121 **** /* put the chunk name into png_ptr->chunk_name */ png_memcpy(png_ptr->chunk_name, buf + 4, 4); ! png_debug2(0, "Reading %s chunk, length = %lu\n", png_ptr->chunk_name, length); /* reset the crc and run it over the chunk name */ --- 115,121 ---- /* put the chunk name into png_ptr->chunk_name */ png_memcpy(png_ptr->chunk_name, buf + 4, 4); ! png_debug2(0, "Reading %s chunk, length = %lu", png_ptr->chunk_name, length); /* reset the crc and run it over the chunk name */ *************** *** 392,398 **** int bit_depth, color_type, compression_type, filter_type; int interlace_type; ! png_debug(1, "in png_handle_IHDR\n"); if (png_ptr->mode & PNG_HAVE_IHDR) png_error(png_ptr, "Out of place IHDR"); --- 392,398 ---- int bit_depth, color_type, compression_type, filter_type; int interlace_type; ! png_debug(1, "in png_handle_IHDR"); if (png_ptr->mode & PNG_HAVE_IHDR) png_error(png_ptr, "Out of place IHDR"); *************** *** 447,455 **** png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth * png_ptr->channels); png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->width); ! png_debug1(3, "bit_depth = %d\n", png_ptr->bit_depth); ! png_debug1(3, "channels = %d\n", png_ptr->channels); ! png_debug1(3, "rowbytes = %lu\n", png_ptr->rowbytes); png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_type); } --- 447,455 ---- png_ptr->pixel_depth = (png_byte)(png_ptr->bit_depth * png_ptr->channels); png_ptr->rowbytes = PNG_ROWBYTES(png_ptr->pixel_depth, png_ptr->width); ! png_debug1(3, "bit_depth = %d", png_ptr->bit_depth); ! png_debug1(3, "channels = %d", png_ptr->channels); ! png_debug1(3, "rowbytes = %lu", png_ptr->rowbytes); png_set_IHDR(png_ptr, info_ptr, width, height, bit_depth, color_type, interlace_type, compression_type, filter_type); } *************** *** 464,470 **** png_colorp pal_ptr; #endif ! png_debug(1, "in png_handle_PLTE\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before PLTE"); --- 464,470 ---- png_colorp pal_ptr; #endif ! png_debug(1, "in png_handle_PLTE"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before PLTE"); *************** *** 596,602 **** void /* PRIVATE */ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { ! png_debug(1, "in png_handle_IEND\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT)) { --- 596,602 ---- void /* PRIVATE */ png_handle_IEND(png_structp png_ptr, png_infop info_ptr, png_uint_32 length) { ! png_debug(1, "in png_handle_IEND"); if (!(png_ptr->mode & PNG_HAVE_IHDR) || !(png_ptr->mode & PNG_HAVE_IDAT)) { *************** *** 624,630 **** #endif png_byte buf[4]; ! png_debug(1, "in png_handle_gAMA\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before gAMA"); --- 624,630 ---- #endif png_byte buf[4]; ! png_debug(1, "in png_handle_gAMA"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before gAMA"); *************** *** 676,682 **** png_warning(png_ptr, "Ignoring incorrect gAMA value when sRGB is also present"); #ifndef PNG_NO_CONSOLE_IO ! fprintf(stderr, "gamma = (%d/100000)\n", (int)igamma); #endif return; } --- 676,682 ---- png_warning(png_ptr, "Ignoring incorrect gAMA value when sRGB is also present"); #ifndef PNG_NO_CONSOLE_IO ! fprintf(stderr, "gamma = (%d/100000)", (int)igamma); #endif return; } *************** *** 702,708 **** png_size_t truelen; png_byte buf[4]; ! png_debug(1, "in png_handle_sBIT\n"); buf[0] = buf[1] = buf[2] = buf[3] = 0; --- 702,708 ---- png_size_t truelen; png_byte buf[4]; ! png_debug(1, "in png_handle_sBIT"); buf[0] = buf[1] = buf[2] = buf[3] = 0; *************** *** 774,780 **** png_uint_32 uint_x, uint_y; ! png_debug(1, "in png_handle_cHRM\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before cHRM"); --- 774,780 ---- png_uint_32 uint_x, uint_y; ! png_debug(1, "in png_handle_cHRM"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before cHRM"); *************** *** 812,853 **** uint_x = png_get_uint_32(buf); uint_y = png_get_uint_32(buf + 4); - if (uint_x > 80000L || uint_y > 80000L || - uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM white point"); - return; - } int_x_white = (png_fixed_point)uint_x; int_y_white = (png_fixed_point)uint_y; uint_x = png_get_uint_32(buf + 8); uint_y = png_get_uint_32(buf + 12); - if (uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM red point"); - return; - } int_x_red = (png_fixed_point)uint_x; int_y_red = (png_fixed_point)uint_y; uint_x = png_get_uint_32(buf + 16); uint_y = png_get_uint_32(buf + 20); - if (uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM green point"); - return; - } int_x_green = (png_fixed_point)uint_x; int_y_green = (png_fixed_point)uint_y; uint_x = png_get_uint_32(buf + 24); uint_y = png_get_uint_32(buf + 28); - if (uint_x + uint_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM blue point"); - return; - } int_x_blue = (png_fixed_point)uint_x; int_y_blue = (png_fixed_point)uint_y; --- 812,832 ---- *************** *** 913,919 **** int intent; png_byte buf[1]; ! png_debug(1, "in png_handle_sRGB\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before sRGB"); --- 892,898 ---- int intent; png_byte buf[1]; ! png_debug(1, "in png_handle_sRGB"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before sRGB"); *************** *** 1016,1022 **** png_uint_32 profile_size, profile_length; png_size_t slength, prefix_length, data_length; ! png_debug(1, "in png_handle_iCCP\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before iCCP"); --- 995,1001 ---- png_uint_32 profile_size, profile_length; png_size_t slength, prefix_length, data_length; ! png_debug(1, "in png_handle_iCCP"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before iCCP"); *************** *** 1137,1143 **** png_uint_32 skip = 0; png_size_t slength; ! png_debug(1, "in png_handle_sPLT\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before sPLT"); --- 1116,1123 ---- png_uint_32 skip = 0; png_size_t slength; ! png_debug(1, "in png_handle_sPLT"); ! if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before sPLT"); *************** *** 1273,1279 **** { png_byte readbuf[PNG_MAX_PALETTE_LENGTH]; ! png_debug(1, "in png_handle_tRNS\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before tRNS"); --- 1253,1259 ---- { png_byte readbuf[PNG_MAX_PALETTE_LENGTH]; ! png_debug(1, "in png_handle_tRNS"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before tRNS"); *************** *** 1369,1375 **** png_size_t truelen; png_byte buf[6]; ! png_debug(1, "in png_handle_bKGD\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before bKGD"); --- 1349,1355 ---- png_size_t truelen; png_byte buf[6]; ! png_debug(1, "in png_handle_bKGD"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before bKGD"); *************** *** 1420,1426 **** png_ptr->background.index = buf[0]; if (info_ptr && info_ptr->num_palette) { ! if (buf[0] > info_ptr->num_palette) { png_warning(png_ptr, "Incorrect bKGD chunk index value"); return; --- 1400,1406 ---- png_ptr->background.index = buf[0]; if (info_ptr && info_ptr->num_palette) { ! if (buf[0] >= info_ptr->num_palette) { png_warning(png_ptr, "Incorrect bKGD chunk index value"); return; *************** *** 1458,1464 **** unsigned int num, i; png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH]; ! png_debug(1, "in png_handle_hIST\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before hIST"); --- 1438,1444 ---- unsigned int num, i; png_uint_16 readbuf[PNG_MAX_PALETTE_LENGTH]; ! png_debug(1, "in png_handle_hIST"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before hIST"); *************** *** 1513,1519 **** png_uint_32 res_x, res_y; int unit_type; ! png_debug(1, "in png_handle_pHYs\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before pHYs"); --- 1493,1499 ---- png_uint_32 res_x, res_y; int unit_type; ! png_debug(1, "in png_handle_pHYs"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before pHYs"); *************** *** 1556,1562 **** png_int_32 offset_x, offset_y; int unit_type; ! png_debug(1, "in png_handle_oFFs\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before oFFs"); --- 1536,1542 ---- png_int_32 offset_x, offset_y; int unit_type; ! png_debug(1, "in png_handle_oFFs"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before oFFs"); *************** *** 1603,1609 **** png_size_t slength; int i; ! png_debug(1, "in png_handle_pCAL\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before pCAL"); --- 1583,1589 ---- png_size_t slength; int i; ! png_debug(1, "in png_handle_pCAL"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before pCAL"); *************** *** 1620,1626 **** return; } ! png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)\n", length + 1); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); --- 1600,1606 ---- return; } ! png_debug1(2, "Allocating and reading pCAL chunk data (%lu bytes)", length + 1); png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); *************** *** 1641,1647 **** png_ptr->chunkdata[slength] = 0x00; /* null terminate the last string */ ! png_debug(3, "Finding end of pCAL purpose string\n"); for (buf = png_ptr->chunkdata; *buf; buf++) /* empty loop */ ; --- 1621,1627 ---- png_ptr->chunkdata[slength] = 0x00; /* null terminate the last string */ ! png_debug(3, "Finding end of pCAL purpose string"); for (buf = png_ptr->chunkdata; *buf; buf++) /* empty loop */ ; *************** *** 1657,1670 **** return; } ! png_debug(3, "Reading pCAL X0, X1, type, nparams, and units\n"); X0 = png_get_int_32((png_bytep)buf+1); X1 = png_get_int_32((png_bytep)buf+5); type = buf[9]; nparams = buf[10]; units = buf + 11; ! png_debug(3, "Checking pCAL equation type and number of parameters\n"); /* Check that we have the right number of parameters for known equation types. */ if ((type == PNG_EQUATION_LINEAR && nparams != 2) || --- 1637,1650 ---- return; } ! png_debug(3, "Reading pCAL X0, X1, type, nparams, and units"); X0 = png_get_int_32((png_bytep)buf+1); X1 = png_get_int_32((png_bytep)buf+5); type = buf[9]; nparams = buf[10]; units = buf + 11; ! png_debug(3, "Checking pCAL equation type and number of parameters"); /* Check that we have the right number of parameters for known equation types. */ if ((type == PNG_EQUATION_LINEAR && nparams != 2) || *************** *** 1685,1691 **** for (buf = units; *buf; buf++) /* Empty loop to move past the units string. */ ; ! png_debug(3, "Allocating pCAL parameters array\n"); params = (png_charpp)png_malloc_warn(png_ptr, (png_uint_32)(nparams * png_sizeof(png_charp))) ; if (params == NULL) --- 1665,1671 ---- for (buf = units; *buf; buf++) /* Empty loop to move past the units string. */ ; ! png_debug(3, "Allocating pCAL parameters array"); params = (png_charpp)png_malloc_warn(png_ptr, (png_uint_32)(nparams * png_sizeof(png_charp))) ; if (params == NULL) *************** *** 1701,1707 **** { buf++; /* Skip the null string terminator from previous parameter. */ ! png_debug1(3, "Reading pCAL parameter %d\n", i); for (params[i] = buf; buf <= endptr && *buf != 0x00; buf++) /* Empty loop to move past each parameter string */ ; --- 1681,1687 ---- { buf++; /* Skip the null string terminator from previous parameter. */ ! png_debug1(3, "Reading pCAL parameter %d", i); for (params[i] = buf; buf <= endptr && *buf != 0x00; buf++) /* Empty loop to move past each parameter string */ ; *************** *** 1741,1747 **** #endif png_size_t slength; ! png_debug(1, "in png_handle_sCAL\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before sCAL"); --- 1721,1727 ---- #endif png_size_t slength; ! png_debug(1, "in png_handle_sCAL"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before sCAL"); *************** *** 1758,1764 **** return; } ! png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)\n", length + 1); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) --- 1738,1744 ---- return; } ! png_debug1(2, "Allocating and reading sCAL chunk data (%lu bytes)", length + 1); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) *************** *** 1875,1881 **** png_byte buf[7]; png_time mod_time; ! png_debug(1, "in png_handle_tIME\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Out of place tIME chunk"); --- 1855,1861 ---- png_byte buf[7]; png_time mod_time; ! png_debug(1, "in png_handle_tIME"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Out of place tIME chunk"); *************** *** 1923,1929 **** png_size_t slength; int ret; ! png_debug(1, "in png_handle_tEXt\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before tEXt"); --- 1903,1910 ---- png_size_t slength; int ret; ! png_debug(1, "in png_handle_tEXt"); ! if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before tEXt"); *************** *** 1940,1960 **** } #endif ! key = (png_charp)png_malloc_warn(png_ptr, length + 1); ! if (key == NULL) { png_warning(png_ptr, "No memory to process text chunk."); return; } slength = (png_size_t)length; ! png_crc_read(png_ptr, (png_bytep)key, slength); if (png_crc_finish(png_ptr, skip)) { ! png_free(png_ptr, key); return; } key[slength] = 0x00; for (text = key; *text; text++) --- 1921,1946 ---- } #endif ! png_free(png_ptr, png_ptr->chunkdata); ! ! png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); ! if (png_ptr->chunkdata == NULL) { png_warning(png_ptr, "No memory to process text chunk."); return; } slength = (png_size_t)length; ! png_crc_read(png_ptr, (png_bytep)png_ptr->chunkdata, slength); if (png_crc_finish(png_ptr, skip)) { ! png_free(png_ptr, png_ptr->chunkdata); ! png_ptr->chunkdata = NULL; return; } + key = png_ptr->chunkdata; + key[slength] = 0x00; for (text = key; *text; text++) *************** *** 1968,1974 **** if (text_ptr == NULL) { png_warning(png_ptr, "Not enough memory to process text chunk."); ! png_free(png_ptr, key); return; } text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; --- 1954,1961 ---- if (text_ptr == NULL) { png_warning(png_ptr, "Not enough memory to process text chunk."); ! png_free(png_ptr, png_ptr->chunkdata); ! png_ptr->chunkdata = NULL; return; } text_ptr->compression = PNG_TEXT_COMPRESSION_NONE; *************** *** 1983,1989 **** ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); ! png_free(png_ptr, key); png_free(png_ptr, text_ptr); if (ret) png_warning(png_ptr, "Insufficient memory to process text chunk."); --- 1970,1977 ---- ret = png_set_text_2(png_ptr, info_ptr, text_ptr, 1); ! png_free(png_ptr, png_ptr->chunkdata); ! png_ptr->chunkdata = NULL; png_free(png_ptr, text_ptr); if (ret) png_warning(png_ptr, "Insufficient memory to process text chunk."); *************** *** 2001,2007 **** int ret; png_size_t slength, prefix_len, data_len; ! png_debug(1, "in png_handle_zTXt\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before zTXt"); --- 1989,1997 ---- int ret; png_size_t slength, prefix_len, data_len; ! png_debug(1, "in png_handle_zTXt"); ! ! if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before zTXt"); *************** *** 2019,2025 **** } #endif ! png_free(png_ptr,png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) { --- 2009,2015 ---- } #endif ! png_free(png_ptr, png_ptr->chunkdata); png_ptr->chunkdata = (png_charp)png_malloc_warn(png_ptr, length + 1); if (png_ptr->chunkdata == NULL) { *************** *** 2104,2110 **** int ret; png_size_t slength, prefix_len, data_len; ! png_debug(1, "in png_handle_iTXt\n"); if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before iTXt"); --- 2094,2101 ---- int ret; png_size_t slength, prefix_len, data_len; ! png_debug(1, "in png_handle_iTXt"); ! if (!(png_ptr->mode & PNG_HAVE_IHDR)) png_error(png_ptr, "Missing IHDR before iTXt"); *************** *** 2230,2236 **** { png_uint_32 skip = 0; ! png_debug(1, "in png_handle_unknown\n"); if (png_ptr->mode & PNG_HAVE_IDAT) { --- 2221,2228 ---- { png_uint_32 skip = 0; ! png_debug(1, "in png_handle_unknown"); ! if (png_ptr->mode & PNG_HAVE_IDAT) { *************** *** 2325,2331 **** void /* PRIVATE */ png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name) { ! png_debug(1, "in png_check_chunk_name\n"); if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) || isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3])) { --- 2317,2323 ---- void /* PRIVATE */ png_check_chunk_name(png_structp png_ptr, png_bytep chunk_name) { ! png_debug(1, "in png_check_chunk_name"); if (isnonalpha(chunk_name[0]) || isnonalpha(chunk_name[1]) || isnonalpha(chunk_name[2]) || isnonalpha(chunk_name[3])) { *************** *** 2347,2353 **** void /* PRIVATE */ png_combine_row(png_structp png_ptr, png_bytep row, int mask) { ! png_debug(1, "in png_combine_row\n"); if (mask == 0xff) { png_memcpy(row, png_ptr->row_buf + 1, --- 2339,2345 ---- void /* PRIVATE */ png_combine_row(png_structp png_ptr, png_bytep row, int mask) { ! png_debug(1, "in png_combine_row"); if (mask == 0xff) { png_memcpy(row, png_ptr->row_buf + 1, *************** *** 2563,2569 **** PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif ! png_debug(1, "in png_do_read_interlace\n"); if (row != NULL && row_info != NULL) { png_uint_32 final_width; --- 2555,2561 ---- PNG_CONST int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif ! png_debug(1, "in png_do_read_interlace"); if (row != NULL && row_info != NULL) { png_uint_32 final_width; *************** *** 2776,2783 **** png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter) { ! png_debug(1, "in png_read_filter_row\n"); ! png_debug2(2, "row = %lu, filter = %d\n", png_ptr->row_number, filter); switch (filter) { case PNG_FILTER_VALUE_NONE: --- 2768,2775 ---- png_read_filter_row(png_structp png_ptr, png_row_infop row_info, png_bytep row, png_bytep prev_row, int filter) { ! png_debug(1, "in png_read_filter_row"); ! png_debug2(2, "row = %lu, filter = %d", png_ptr->row_number, filter); switch (filter) { case PNG_FILTER_VALUE_NONE: *************** *** 2916,2922 **** #endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif ! png_debug(1, "in png_read_finish_row\n"); png_ptr->row_number++; if (png_ptr->row_number < png_ptr->num_rows) return; --- 2908,2914 ---- #endif /* PNG_READ_INTERLACING_SUPPORTED */ #endif ! png_debug(1, "in png_read_finish_row"); png_ptr->row_number++; if (png_ptr->row_number < png_ptr->num_rows) return; *************** *** 3051,3057 **** int max_pixel_depth; png_size_t row_bytes; ! png_debug(1, "in png_read_start_row\n"); png_ptr->zstream.avail_in = 0; png_init_read_transformations(png_ptr); #ifdef PNG_READ_INTERLACING_SUPPORTED --- 3043,3049 ---- int max_pixel_depth; png_size_t row_bytes; ! png_debug(1, "in png_read_start_row"); png_ptr->zstream.avail_in = 0; png_init_read_transformations(png_ptr); #ifdef PNG_READ_INTERLACING_SUPPORTED *************** *** 3217,3228 **** png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1); ! png_debug1(3, "width = %lu,\n", png_ptr->width); ! png_debug1(3, "height = %lu,\n", png_ptr->height); ! png_debug1(3, "iwidth = %lu,\n", png_ptr->iwidth); ! png_debug1(3, "num_rows = %lu\n", png_ptr->num_rows); ! png_debug1(3, "rowbytes = %lu,\n", png_ptr->rowbytes); ! png_debug1(3, "irowbytes = %lu,\n", png_ptr->irowbytes); png_ptr->flags |= PNG_FLAG_ROW_INIT; } --- 3209,3220 ---- png_memset_check(png_ptr, png_ptr->prev_row, 0, png_ptr->rowbytes + 1); ! png_debug1(3, "width = %lu,", png_ptr->width); ! png_debug1(3, "height = %lu,", png_ptr->height); ! png_debug1(3, "iwidth = %lu,", png_ptr->iwidth); ! png_debug1(3, "num_rows = %lu,", png_ptr->num_rows); ! png_debug1(3, "rowbytes = %lu,", png_ptr->rowbytes); ! png_debug1(3, "irowbytes = %lu", png_ptr->irowbytes); png_ptr->flags |= PNG_FLAG_ROW_INIT; } Index: pngset.c =================================================================== RCS file: /cvs/mushclient/pngset.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngset.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngset.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,9 **** /* pngset.c - storage of image information into info struct * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * --- 1,9 ---- /* pngset.c - storage of image information into info struct * ! * Last changed in libpng 1.2.35 [February 14, 2009] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * *************** *** 21,27 **** void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) { ! png_debug1(1, "in %s storage function\n", "bKGD"); if (png_ptr == NULL || info_ptr == NULL) return; --- 21,27 ---- void PNGAPI png_set_bKGD(png_structp png_ptr, png_infop info_ptr, png_color_16p background) { ! png_debug1(1, "in %s storage function", "bKGD"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 37,70 **** double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y) { ! png_debug1(1, "in %s storage function\n", "cHRM"); if (png_ptr == NULL || info_ptr == NULL) return; - if (!(white_x || white_y || red_x || red_y || green_x || green_y || - blue_x || blue_y)) - { - png_warning(png_ptr, - "Ignoring attempt to set all-zero chromaticity values"); - return; - } - if (white_x < 0.0 || white_y < 0.0 || - red_x < 0.0 || red_y < 0.0 || - green_x < 0.0 || green_y < 0.0 || - blue_x < 0.0 || blue_y < 0.0) - { - png_warning(png_ptr, - "Ignoring attempt to set negative chromaticity value"); - return; - } - if (white_x > 21474.83 || white_y > 21474.83 || - red_x > 21474.83 || red_y > 21474.83 || - green_x > 21474.83 || green_y > 21474.83 || - blue_x > 21474.83 || blue_y > 21474.83) - { - png_warning(png_ptr, - "Ignoring attempt to set chromaticity value exceeding 21474.83"); - return; - } info_ptr->x_white = (float)white_x; info_ptr->y_white = (float)white_y; --- 37,45 ---- double white_x, double white_y, double red_x, double red_y, double green_x, double green_y, double blue_x, double blue_y) { ! png_debug1(1, "in %s storage function", "cHRM"); if (png_ptr == NULL || info_ptr == NULL) return; info_ptr->x_white = (float)white_x; info_ptr->y_white = (float)white_y; *************** *** 86,92 **** #endif info_ptr->valid |= PNG_INFO_cHRM; } ! #endif #ifdef PNG_FIXED_POINT_SUPPORTED void PNGAPI png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, --- 61,68 ---- #endif info_ptr->valid |= PNG_INFO_cHRM; } ! #endif /* PNG_FLOATING_POINT_SUPPORTED */ ! #ifdef PNG_FIXED_POINT_SUPPORTED void PNGAPI png_set_cHRM_fixed(png_structp png_ptr, png_infop info_ptr, *************** *** 94,154 **** png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y) { ! png_debug1(1, "in %s storage function\n", "cHRM"); if (png_ptr == NULL || info_ptr == NULL) return; ! if (!(white_x || white_y || red_x || red_y || green_x || green_y || ! blue_x || blue_y)) ! { ! png_warning(png_ptr, ! "Ignoring attempt to set all-zero chromaticity values"); ! return; ! } ! if (white_x < 0 || white_y < 0 || ! red_x < 0 || red_y < 0 || ! green_x < 0 || green_y < 0 || ! blue_x < 0 || blue_y < 0) ! { ! png_warning(png_ptr, ! "Ignoring attempt to set negative chromaticity value"); ! return; ! } ! if (white_x > (png_fixed_point) PNG_UINT_31_MAX || ! white_y > (png_fixed_point) PNG_UINT_31_MAX || ! red_x > (png_fixed_point) PNG_UINT_31_MAX || ! red_y > (png_fixed_point) PNG_UINT_31_MAX || ! green_x > (png_fixed_point) PNG_UINT_31_MAX || ! green_y > (png_fixed_point) PNG_UINT_31_MAX || ! blue_x > (png_fixed_point) PNG_UINT_31_MAX || ! blue_y > (png_fixed_point) PNG_UINT_31_MAX ) { ! png_warning(png_ptr, ! "Ignoring attempt to set chromaticity value exceeding 21474.83"); ! return; ! } ! info_ptr->int_x_white = white_x; ! info_ptr->int_y_white = white_y; ! info_ptr->int_x_red = red_x; ! info_ptr->int_y_red = red_y; ! info_ptr->int_x_green = green_x; ! info_ptr->int_y_green = green_y; ! info_ptr->int_x_blue = blue_x; ! info_ptr->int_y_blue = blue_y; #ifdef PNG_FLOATING_POINT_SUPPORTED ! info_ptr->x_white = (float)(white_x/100000.); ! info_ptr->y_white = (float)(white_y/100000.); ! info_ptr->x_red = (float)( red_x/100000.); ! info_ptr->y_red = (float)( red_y/100000.); ! info_ptr->x_green = (float)(green_x/100000.); ! info_ptr->y_green = (float)(green_y/100000.); ! info_ptr->x_blue = (float)( blue_x/100000.); ! info_ptr->y_blue = (float)( blue_y/100000.); #endif ! info_ptr->valid |= PNG_INFO_cHRM; } ! #endif ! #endif #if defined(PNG_gAMA_SUPPORTED) #ifdef PNG_FLOATING_POINT_SUPPORTED --- 70,107 ---- png_fixed_point red_y, png_fixed_point green_x, png_fixed_point green_y, png_fixed_point blue_x, png_fixed_point blue_y) { ! png_debug1(1, "in %s storage function", "cHRM fixed"); if (png_ptr == NULL || info_ptr == NULL) return; ! #if !defined(PNG_NO_CHECK_cHRM) ! if (png_check_cHRM_fixed(png_ptr, ! white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y)) ! #endif { ! info_ptr->int_x_white = white_x; ! info_ptr->int_y_white = white_y; ! info_ptr->int_x_red = red_x; ! info_ptr->int_y_red = red_y; ! info_ptr->int_x_green = green_x; ! info_ptr->int_y_green = green_y; ! info_ptr->int_x_blue = blue_x; ! info_ptr->int_y_blue = blue_y; #ifdef PNG_FLOATING_POINT_SUPPORTED ! info_ptr->x_white = (float)(white_x/100000.); ! info_ptr->y_white = (float)(white_y/100000.); ! info_ptr->x_red = (float)( red_x/100000.); ! info_ptr->y_red = (float)( red_y/100000.); ! info_ptr->x_green = (float)(green_x/100000.); ! info_ptr->y_green = (float)(green_y/100000.); ! info_ptr->x_blue = (float)( blue_x/100000.); ! info_ptr->y_blue = (float)( blue_y/100000.); #endif ! info_ptr->valid |= PNG_INFO_cHRM; ! } } ! #endif /* PNG_FIXED_POINT_SUPPORTED */ ! #endif /* PNG_cHRM_SUPPORTED */ #if defined(PNG_gAMA_SUPPORTED) #ifdef PNG_FLOATING_POINT_SUPPORTED *************** *** 156,162 **** png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) { double gamma; ! png_debug1(1, "in %s storage function\n", "gAMA"); if (png_ptr == NULL || info_ptr == NULL) return; --- 109,115 ---- png_set_gAMA(png_structp png_ptr, png_infop info_ptr, double file_gamma) { double gamma; ! png_debug1(1, "in %s storage function", "gAMA"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 183,189 **** { png_fixed_point gamma; ! png_debug1(1, "in %s storage function\n", "gAMA"); if (png_ptr == NULL || info_ptr == NULL) return; --- 136,142 ---- { png_fixed_point gamma; ! png_debug1(1, "in %s storage function", "gAMA"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 220,226 **** { int i; ! png_debug1(1, "in %s storage function\n", "hIST"); if (png_ptr == NULL || info_ptr == NULL) return; if (info_ptr->num_palette == 0 || info_ptr->num_palette --- 173,179 ---- { int i; ! png_debug1(1, "in %s storage function", "hIST"); if (png_ptr == NULL || info_ptr == NULL) return; if (info_ptr->num_palette == 0 || info_ptr->num_palette *************** *** 263,269 **** int color_type, int interlace_type, int compression_type, int filter_type) { ! png_debug1(1, "in %s storage function\n", "IHDR"); if (png_ptr == NULL || info_ptr == NULL) return; --- 216,222 ---- int color_type, int interlace_type, int compression_type, int filter_type) { ! png_debug1(1, "in %s storage function", "IHDR"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 370,376 **** png_set_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type) { ! png_debug1(1, "in %s storage function\n", "oFFs"); if (png_ptr == NULL || info_ptr == NULL) return; --- 323,329 ---- png_set_oFFs(png_structp png_ptr, png_infop info_ptr, png_int_32 offset_x, png_int_32 offset_y, int unit_type) { ! png_debug1(1, "in %s storage function", "oFFs"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 390,401 **** png_uint_32 length; int i; ! png_debug1(1, "in %s storage function\n", "pCAL"); if (png_ptr == NULL || info_ptr == NULL) return; length = png_strlen(purpose) + 1; ! png_debug1(3, "allocating purpose for info (%lu bytes)\n", (unsigned long)length); info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->pcal_purpose == NULL) --- 343,354 ---- png_uint_32 length; int i; ! png_debug1(1, "in %s storage function", "pCAL"); if (png_ptr == NULL || info_ptr == NULL) return; length = png_strlen(purpose) + 1; ! png_debug1(3, "allocating purpose for info (%lu bytes)", (unsigned long)length); info_ptr->pcal_purpose = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->pcal_purpose == NULL) *************** *** 405,418 **** } png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length); ! png_debug(3, "storing X0, X1, type, and nparams in info\n"); info_ptr->pcal_X0 = X0; info_ptr->pcal_X1 = X1; info_ptr->pcal_type = (png_byte)type; info_ptr->pcal_nparams = (png_byte)nparams; length = png_strlen(units) + 1; ! png_debug1(3, "allocating units for info (%lu bytes)\n", (unsigned long)length); info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->pcal_units == NULL) --- 358,371 ---- } png_memcpy(info_ptr->pcal_purpose, purpose, (png_size_t)length); ! png_debug(3, "storing X0, X1, type, and nparams in info"); info_ptr->pcal_X0 = X0; info_ptr->pcal_X1 = X1; info_ptr->pcal_type = (png_byte)type; info_ptr->pcal_nparams = (png_byte)nparams; length = png_strlen(units) + 1; ! png_debug1(3, "allocating units for info (%lu bytes)", (unsigned long)length); info_ptr->pcal_units = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->pcal_units == NULL) *************** *** 430,441 **** return; } ! info_ptr->pcal_params[nparams] = NULL; for (i = 0; i < nparams; i++) { length = png_strlen(params[i]) + 1; ! png_debug2(3, "allocating parameter %d for info (%lu bytes)\n", i, (unsigned long)length); info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->pcal_params[i] == NULL) --- 383,398 ---- return; } ! #ifdef PNG_FREE_ME_SUPPORTED ! info_ptr->free_me |= PNG_FREE_PCAL; ! #endif ! ! png_memset(info_ptr->pcal_params, 0, (nparams + 1) * png_sizeof(png_charp)); for (i = 0; i < nparams; i++) { length = png_strlen(params[i]) + 1; ! png_debug2(3, "allocating parameter %d for info (%lu bytes)", i, (unsigned long)length); info_ptr->pcal_params[i] = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->pcal_params[i] == NULL) *************** *** 447,455 **** } info_ptr->valid |= PNG_INFO_pCAL; - #ifdef PNG_FREE_ME_SUPPORTED - info_ptr->free_me |= PNG_FREE_PCAL; - #endif } #endif --- 404,409 ---- *************** *** 459,465 **** png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height) { ! png_debug1(1, "in %s storage function\n", "sCAL"); if (png_ptr == NULL || info_ptr == NULL) return; --- 413,419 ---- png_set_sCAL(png_structp png_ptr, png_infop info_ptr, int unit, double width, double height) { ! png_debug1(1, "in %s storage function", "sCAL"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 477,490 **** { png_uint_32 length; ! png_debug1(1, "in %s storage function\n", "sCAL"); if (png_ptr == NULL || info_ptr == NULL) return; info_ptr->scal_unit = (png_byte)unit; length = png_strlen(swidth) + 1; ! png_debug1(3, "allocating unit for info (%u bytes)\n", (unsigned int)length); info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->scal_s_width == NULL) --- 431,444 ---- { png_uint_32 length; ! png_debug1(1, "in %s storage function", "sCAL"); if (png_ptr == NULL || info_ptr == NULL) return; info_ptr->scal_unit = (png_byte)unit; length = png_strlen(swidth) + 1; ! png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)length); info_ptr->scal_s_width = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->scal_s_width == NULL) *************** *** 496,502 **** png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length); length = png_strlen(sheight) + 1; ! png_debug1(3, "allocating unit for info (%u bytes)\n", (unsigned int)length); info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->scal_s_height == NULL) --- 450,456 ---- png_memcpy(info_ptr->scal_s_width, swidth, (png_size_t)length); length = png_strlen(sheight) + 1; ! png_debug1(3, "allocating unit for info (%u bytes)", (unsigned int)length); info_ptr->scal_s_height = (png_charp)png_malloc_warn(png_ptr, length); if (info_ptr->scal_s_height == NULL) *************** *** 522,528 **** png_set_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type) { ! png_debug1(1, "in %s storage function\n", "pHYs"); if (png_ptr == NULL || info_ptr == NULL) return; --- 476,482 ---- png_set_pHYs(png_structp png_ptr, png_infop info_ptr, png_uint_32 res_x, png_uint_32 res_y, int unit_type) { ! png_debug1(1, "in %s storage function", "pHYs"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 538,544 **** png_colorp palette, int num_palette) { ! png_debug1(1, "in %s storage function\n", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; --- 492,498 ---- png_colorp palette, int num_palette) { ! png_debug1(1, "in %s storage function", "PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 587,593 **** png_set_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p sig_bit) { ! png_debug1(1, "in %s storage function\n", "sBIT"); if (png_ptr == NULL || info_ptr == NULL) return; --- 541,547 ---- png_set_sBIT(png_structp png_ptr, png_infop info_ptr, png_color_8p sig_bit) { ! png_debug1(1, "in %s storage function", "sBIT"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 600,606 **** void PNGAPI png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) { ! png_debug1(1, "in %s storage function\n", "sRGB"); if (png_ptr == NULL || info_ptr == NULL) return; --- 554,560 ---- void PNGAPI png_set_sRGB(png_structp png_ptr, png_infop info_ptr, int intent) { ! png_debug1(1, "in %s storage function", "sRGB"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 624,635 **** #ifdef PNG_FLOATING_POINT_SUPPORTED float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; #endif - #ifdef PNG_FIXED_POINT_SUPPORTED png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y; #endif ! #endif ! png_debug1(1, "in %s storage function\n", "sRGB_gAMA_and_cHRM"); if (png_ptr == NULL || info_ptr == NULL) return; --- 578,587 ---- #ifdef PNG_FLOATING_POINT_SUPPORTED float white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y; #endif png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y; #endif ! png_debug1(1, "in %s storage function", "sRGB_gAMA_and_cHRM"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 647,653 **** #endif #if defined(PNG_cHRM_SUPPORTED) - #ifdef PNG_FIXED_POINT_SUPPORTED int_white_x = 31270L; int_white_y = 32900L; int_red_x = 64000L; --- 599,604 ---- *************** *** 657,666 **** int_blue_x = 15000L; int_blue_y = 6000L; - png_set_cHRM_fixed(png_ptr, info_ptr, - int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, int_green_y, - int_blue_x, int_blue_y); - #endif #ifdef PNG_FLOATING_POINT_SUPPORTED white_x = (float).3127; white_y = (float).3290; --- 608,613 ---- *************** *** 670,682 **** green_y = (float).60; blue_x = (float).15; blue_y = (float).06; ! png_set_cHRM(png_ptr, info_ptr, ! white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); #endif #endif } ! #endif #if defined(PNG_iCCP_SUPPORTED) --- 617,643 ---- green_y = (float).60; blue_x = (float).15; blue_y = (float).06; + #endif ! #if !defined(PNG_NO_CHECK_cHRM) ! if (png_check_cHRM_fixed(png_ptr, ! int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, ! int_green_y, int_blue_x, int_blue_y)) ! #endif ! { ! #ifdef PNG_FIXED_POINT_SUPPORTED ! png_set_cHRM_fixed(png_ptr, info_ptr, ! int_white_x, int_white_y, int_red_x, int_red_y, int_green_x, ! int_green_y, int_blue_x, int_blue_y); #endif + #ifdef PNG_FLOATING_POINT_SUPPORTED + png_set_cHRM(png_ptr, info_ptr, + white_x, white_y, red_x, red_y, green_x, green_y, blue_x, blue_y); #endif + } + #endif /* cHRM */ } ! #endif /* sRGB */ #if defined(PNG_iCCP_SUPPORTED) *************** *** 689,695 **** png_charp new_iccp_profile; png_uint_32 length; ! png_debug1(1, "in %s storage function\n", "iCCP"); if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) return; --- 650,656 ---- png_charp new_iccp_profile; png_uint_32 length; ! png_debug1(1, "in %s storage function", "iCCP"); if (png_ptr == NULL || info_ptr == NULL || name == NULL || profile == NULL) return; *************** *** 743,749 **** { int i; ! png_debug1(1, "in %s storage function\n", (png_ptr->chunk_name[0] == '\0' ? "text" : (png_const_charp)png_ptr->chunk_name)); if (png_ptr == NULL || info_ptr == NULL || num_text == 0) --- 704,710 ---- { int i; ! png_debug1(1, "in %s storage function", (png_ptr->chunk_name[0] == '\0' ? "text" : (png_const_charp)png_ptr->chunk_name)); if (png_ptr == NULL || info_ptr == NULL || num_text == 0) *************** *** 785,791 **** info_ptr->free_me |= PNG_FREE_TEXT; #endif } ! png_debug1(3, "allocated %d entries for info_ptr->text\n", info_ptr->max_text); } for (i = 0; i < num_text; i++) --- 746,752 ---- info_ptr->free_me |= PNG_FREE_TEXT; #endif } ! png_debug1(3, "allocated %d entries for info_ptr->text", info_ptr->max_text); } for (i = 0; i < num_text; i++) *************** *** 845,851 **** (key_len + text_length + lang_len + lang_key_len + 4)); if (textp->key == NULL) return(1); ! png_debug2(2, "Allocated %lu bytes at %x in png_set_text\n", (png_uint_32) (key_len + lang_len + lang_key_len + text_length + 4), (int)textp->key); --- 806,812 ---- (key_len + text_length + lang_len + lang_key_len + 4)); if (textp->key == NULL) return(1); ! png_debug2(2, "Allocated %lu bytes at %x in png_set_text", (png_uint_32) (key_len + lang_len + lang_key_len + text_length + 4), (int)textp->key); *************** *** 893,899 **** #endif } info_ptr->num_text++; ! png_debug1(3, "transferred text chunk %d\n", info_ptr->num_text); } return(0); } --- 854,860 ---- #endif } info_ptr->num_text++; ! png_debug1(3, "transferred text chunk %d", info_ptr->num_text); } return(0); } *************** *** 903,909 **** void PNGAPI png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) { ! png_debug1(1, "in %s storage function\n", "tIME"); if (png_ptr == NULL || info_ptr == NULL || (png_ptr->mode & PNG_WROTE_tIME)) return; --- 864,870 ---- void PNGAPI png_set_tIME(png_structp png_ptr, png_infop info_ptr, png_timep mod_time) { ! png_debug1(1, "in %s storage function", "tIME"); if (png_ptr == NULL || info_ptr == NULL || (png_ptr->mode & PNG_WROTE_tIME)) return; *************** *** 918,924 **** png_set_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep trans, int num_trans, png_color_16p trans_values) { ! png_debug1(1, "in %s storage function\n", "tRNS"); if (png_ptr == NULL || info_ptr == NULL) return; --- 879,885 ---- png_set_tRNS(png_structp png_ptr, png_infop info_ptr, png_bytep trans, int num_trans, png_color_16p trans_values) { ! png_debug1(1, "in %s storage function", "tRNS"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 1000,1005 **** --- 961,967 ---- png_memcpy(np, info_ptr->splt_palettes, info_ptr->splt_palettes_num * png_sizeof(png_sPLT_t)); + png_free(png_ptr, info_ptr->splt_palettes); info_ptr->splt_palettes=NULL; *************** *** 1123,1129 **** { /* This function is deprecated in favor of png_permit_mng_features() and will be removed from libpng-1.3.0 */ ! png_debug(1, "in png_permit_empty_plte, DEPRECATED.\n"); if (png_ptr == NULL) return; png_ptr->mng_features_permitted = (png_byte) --- 1085,1091 ---- { /* This function is deprecated in favor of png_permit_mng_features() and will be removed from libpng-1.3.0 */ ! png_debug(1, "in png_permit_empty_plte, DEPRECATED."); if (png_ptr == NULL) return; png_ptr->mng_features_permitted = (png_byte) *************** *** 1137,1143 **** png_uint_32 PNGAPI png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) { ! png_debug(1, "in png_permit_mng_features\n"); if (png_ptr == NULL) return (png_uint_32)0; png_ptr->mng_features_permitted = --- 1099,1105 ---- png_uint_32 PNGAPI png_permit_mng_features (png_structp png_ptr, png_uint_32 mng_features) { ! png_debug(1, "in png_permit_mng_features"); if (png_ptr == NULL) return (png_uint_32)0; png_ptr->mng_features_permitted = *************** *** 1198,1204 **** png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn) { ! png_debug(1, "in png_set_read_user_chunk_fn\n"); if (png_ptr == NULL) return; png_ptr->read_user_chunk_fn = read_user_chunk_fn; --- 1160,1166 ---- png_set_read_user_chunk_fn(png_structp png_ptr, png_voidp user_chunk_ptr, png_user_chunk_ptr read_user_chunk_fn) { ! png_debug(1, "in png_set_read_user_chunk_fn"); if (png_ptr == NULL) return; png_ptr->read_user_chunk_fn = read_user_chunk_fn; *************** *** 1210,1216 **** void PNGAPI png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) { ! png_debug1(1, "in %s storage function\n", "rows"); if (png_ptr == NULL || info_ptr == NULL) return; --- 1172,1178 ---- void PNGAPI png_set_rows(png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers) { ! png_debug1(1, "in %s storage function", "rows"); if (png_ptr == NULL || info_ptr == NULL) return; Index: pngtrans.c =================================================================== RCS file: /cvs/mushclient/pngtrans.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngtrans.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngtrans.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 17,23 **** void PNGAPI png_set_bgr(png_structp png_ptr) { ! png_debug(1, "in png_set_bgr\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_BGR; } --- 17,23 ---- void PNGAPI png_set_bgr(png_structp png_ptr) { ! png_debug(1, "in png_set_bgr"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_BGR; } *************** *** 28,34 **** void PNGAPI png_set_swap(png_structp png_ptr) { ! png_debug(1, "in png_set_swap\n"); if (png_ptr == NULL) return; if (png_ptr->bit_depth == 16) png_ptr->transformations |= PNG_SWAP_BYTES; --- 28,34 ---- void PNGAPI png_set_swap(png_structp png_ptr) { ! png_debug(1, "in png_set_swap"); if (png_ptr == NULL) return; if (png_ptr->bit_depth == 16) png_ptr->transformations |= PNG_SWAP_BYTES; *************** *** 40,46 **** void PNGAPI png_set_packing(png_structp png_ptr) { ! png_debug(1, "in png_set_packing\n"); if (png_ptr == NULL) return; if (png_ptr->bit_depth < 8) { --- 40,46 ---- void PNGAPI png_set_packing(png_structp png_ptr) { ! png_debug(1, "in png_set_packing"); if (png_ptr == NULL) return; if (png_ptr->bit_depth < 8) { *************** *** 55,61 **** void PNGAPI png_set_packswap(png_structp png_ptr) { ! png_debug(1, "in png_set_packswap\n"); if (png_ptr == NULL) return; if (png_ptr->bit_depth < 8) png_ptr->transformations |= PNG_PACKSWAP; --- 55,61 ---- void PNGAPI png_set_packswap(png_structp png_ptr) { ! png_debug(1, "in png_set_packswap"); if (png_ptr == NULL) return; if (png_ptr->bit_depth < 8) png_ptr->transformations |= PNG_PACKSWAP; *************** *** 66,72 **** void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits) { ! png_debug(1, "in png_set_shift\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_SHIFT; png_ptr->shift = *true_bits; --- 66,72 ---- void PNGAPI png_set_shift(png_structp png_ptr, png_color_8p true_bits) { ! png_debug(1, "in png_set_shift"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_SHIFT; png_ptr->shift = *true_bits; *************** *** 78,84 **** int PNGAPI png_set_interlace_handling(png_structp png_ptr) { ! png_debug(1, "in png_set_interlace handling\n"); if (png_ptr && png_ptr->interlaced) { png_ptr->transformations |= PNG_INTERLACE; --- 78,84 ---- int PNGAPI png_set_interlace_handling(png_structp png_ptr) { ! png_debug(1, "in png_set_interlace handling"); if (png_ptr && png_ptr->interlaced) { png_ptr->transformations |= PNG_INTERLACE; *************** *** 98,104 **** void PNGAPI png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) { ! png_debug(1, "in png_set_filler\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_FILLER; png_ptr->filler = (png_byte)filler; --- 98,104 ---- void PNGAPI png_set_filler(png_structp png_ptr, png_uint_32 filler, int filler_loc) { ! png_debug(1, "in png_set_filler"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_FILLER; png_ptr->filler = (png_byte)filler; *************** *** 131,137 **** void PNGAPI png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) { ! png_debug(1, "in png_set_add_alpha\n"); if (png_ptr == NULL) return; png_set_filler(png_ptr, filler, filler_loc); png_ptr->transformations |= PNG_ADD_ALPHA; --- 131,137 ---- void PNGAPI png_set_add_alpha(png_structp png_ptr, png_uint_32 filler, int filler_loc) { ! png_debug(1, "in png_set_add_alpha"); if (png_ptr == NULL) return; png_set_filler(png_ptr, filler, filler_loc); png_ptr->transformations |= PNG_ADD_ALPHA; *************** *** 145,151 **** void PNGAPI png_set_swap_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_swap_alpha\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_SWAP_ALPHA; } --- 145,151 ---- void PNGAPI png_set_swap_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_swap_alpha"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_SWAP_ALPHA; } *************** *** 156,162 **** void PNGAPI png_set_invert_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_invert_alpha\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_ALPHA; } --- 156,162 ---- void PNGAPI png_set_invert_alpha(png_structp png_ptr) { ! png_debug(1, "in png_set_invert_alpha"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_ALPHA; } *************** *** 166,172 **** void PNGAPI png_set_invert_mono(png_structp png_ptr) { ! png_debug(1, "in png_set_invert_mono\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_MONO; } --- 166,172 ---- void PNGAPI png_set_invert_mono(png_structp png_ptr) { ! png_debug(1, "in png_set_invert_mono"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_INVERT_MONO; } *************** *** 175,181 **** void /* PRIVATE */ png_do_invert(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_invert\n"); /* This test removed from libpng version 1.0.13 and 1.2.0: * if (row_info->bit_depth == 1 && */ --- 175,181 ---- void /* PRIVATE */ png_do_invert(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_invert"); /* This test removed from libpng version 1.0.13 and 1.2.0: * if (row_info->bit_depth == 1 && */ *************** *** 230,236 **** void /* PRIVATE */ png_do_swap(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_swap\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 230,236 ---- void /* PRIVATE */ png_do_swap(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_swap"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 361,367 **** void /* PRIVATE */ png_do_packswap(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_packswap\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 361,367 ---- void /* PRIVATE */ png_do_packswap(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_packswap"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 393,399 **** void /* PRIVATE */ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) { ! png_debug(1, "in png_do_strip_filler\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 393,399 ---- void /* PRIVATE */ png_do_strip_filler(png_row_infop row_info, png_bytep row, png_uint_32 flags) { ! png_debug(1, "in png_do_strip_filler"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 551,557 **** void /* PRIVATE */ png_do_bgr(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_bgr\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 551,557 ---- void /* PRIVATE */ png_do_bgr(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_bgr"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 630,636 **** png_set_user_transform_info(png_structp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels) { ! png_debug(1, "in png_set_user_transform_info\n"); if (png_ptr == NULL) return; #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_ptr->user_transform_ptr = user_transform_ptr; --- 630,636 ---- png_set_user_transform_info(png_structp png_ptr, png_voidp user_transform_ptr, int user_transform_depth, int user_transform_channels) { ! png_debug(1, "in png_set_user_transform_info"); if (png_ptr == NULL) return; #if defined(PNG_USER_TRANSFORM_PTR_SUPPORTED) png_ptr->user_transform_ptr = user_transform_ptr; Index: pngwio.c =================================================================== RCS file: /cvs/mushclient/pngwio.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngwio.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngwio.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,9 **** /* pngwio.c - functions for data output * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * --- 1,9 ---- /* pngwio.c - functions for data output * ! * Last changed in libpng 1.2.35 [February 14, 2009] * For conditions of distribution and use, see copyright notice in png.h ! * Copyright (c) 1998-2009 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * *************** *** 137,143 **** if (png_ptr == NULL) return; #if !defined(_WIN32_WCE) io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); ! if (io_ptr != NULL) fflush(io_ptr); #endif } --- 137,143 ---- if (png_ptr == NULL) return; #if !defined(_WIN32_WCE) io_ptr = (png_FILE_p)CVT_PTR((png_ptr->io_ptr)); ! if (io_ptr != NULL && fileno(io_ptr) != -1) fflush(io_ptr); #endif } Index: pngwrite.c =================================================================== RCS file: /cvs/mushclient/pngwrite.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngwrite.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngwrite.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,7 **** /* pngwrite.c - general routines to write a PNG file * ! * Last changed in libpng 1.2.31 [August 21, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) --- 1,7 ---- /* pngwrite.c - general routines to write a PNG file * ! * Last changed in libpng 1.2.34 [December 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) *************** *** 25,31 **** void PNGAPI png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_write_info_before_PLTE\n"); if (png_ptr == NULL || info_ptr == NULL) return; if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) --- 25,31 ---- void PNGAPI png_write_info_before_PLTE(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_write_info_before_PLTE"); if (png_ptr == NULL || info_ptr == NULL) return; if (!(png_ptr->mode & PNG_WROTE_INFO_BEFORE_PLTE)) *************** *** 99,105 **** { png_unknown_chunk *up; ! png_debug(5, "writing extra chunks\n"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; --- 99,105 ---- { png_unknown_chunk *up; ! png_debug(5, "writing extra chunks"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; *************** *** 130,136 **** int i; #endif ! png_debug(1, "in png_write_info\n"); if (png_ptr == NULL || info_ptr == NULL) return; --- 130,136 ---- int i; #endif ! png_debug(1, "in png_write_info"); if (png_ptr == NULL || info_ptr == NULL) return; *************** *** 215,221 **** /* Check to see if we need to write text chunks */ for (i = 0; i < info_ptr->num_text; i++) { ! png_debug2(2, "Writing header text chunk %d, type %d\n", i, info_ptr->text[i].compression); /* an internationalized chunk? */ if (info_ptr->text[i].compression > 0) --- 215,221 ---- /* Check to see if we need to write text chunks */ for (i = 0; i < info_ptr->num_text; i++) { ! png_debug2(2, "Writing header text chunk %d, type %d", i, info_ptr->text[i].compression); /* an internationalized chunk? */ if (info_ptr->text[i].compression > 0) *************** *** 268,274 **** { png_unknown_chunk *up; ! png_debug(5, "writing extra chunks\n"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; --- 268,274 ---- { png_unknown_chunk *up; ! png_debug(5, "writing extra chunks"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; *************** *** 296,302 **** void PNGAPI png_write_end(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_write_end\n"); if (png_ptr == NULL) return; if (!(png_ptr->mode & PNG_HAVE_IDAT)) --- 296,302 ---- void PNGAPI png_write_end(png_structp png_ptr, png_infop info_ptr) { ! png_debug(1, "in png_write_end"); if (png_ptr == NULL) return; if (!(png_ptr->mode & PNG_HAVE_IDAT)) *************** *** 318,324 **** /* loop through comment chunks */ for (i = 0; i < info_ptr->num_text; i++) { ! png_debug2(2, "Writing trailer text chunk %d, type %d\n", i, info_ptr->text[i].compression); /* an internationalized chunk? */ if (info_ptr->text[i].compression > 0) --- 318,324 ---- /* loop through comment chunks */ for (i = 0; i < info_ptr->num_text; i++) { ! png_debug2(2, "Writing trailer text chunk %d, type %d", i, info_ptr->text[i].compression); /* an internationalized chunk? */ if (info_ptr->text[i].compression > 0) *************** *** 370,376 **** { png_unknown_chunk *up; ! png_debug(5, "writing extra chunks\n"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; --- 370,376 ---- { png_unknown_chunk *up; ! png_debug(5, "writing extra chunks"); for (up = info_ptr->unknown_chunks; up < info_ptr->unknown_chunks + info_ptr->unknown_chunks_num; *************** *** 413,419 **** void PNGAPI png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime) { ! png_debug(1, "in png_convert_from_struct_tm\n"); ptime->year = (png_uint_16)(1900 + ttime->tm_year); ptime->month = (png_byte)(ttime->tm_mon + 1); ptime->day = (png_byte)ttime->tm_mday; --- 413,419 ---- void PNGAPI png_convert_from_struct_tm(png_timep ptime, struct tm FAR * ttime) { ! png_debug(1, "in png_convert_from_struct_tm"); ptime->year = (png_uint_16)(1900 + ttime->tm_year); ptime->month = (png_byte)(ttime->tm_mon + 1); ptime->day = (png_byte)ttime->tm_mday; *************** *** 427,433 **** { struct tm *tbuf; ! png_debug(1, "in png_convert_from_time_t\n"); tbuf = gmtime(&ttime); png_convert_from_struct_tm(ptime, tbuf); } --- 427,433 ---- { struct tm *tbuf; ! png_debug(1, "in png_convert_from_time_t"); tbuf = gmtime(&ttime); png_convert_from_struct_tm(ptime, tbuf); } *************** *** 461,467 **** #endif #endif int i; ! png_debug(1, "in png_create_write_struct\n"); #ifdef PNG_USER_MEM_SUPPORTED png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); --- 461,467 ---- #endif #endif int i; ! png_debug(1, "in png_create_write_struct"); #ifdef PNG_USER_MEM_SUPPORTED png_ptr = (png_structp)png_create_struct_2(PNG_STRUCT_PNG, (png_malloc_ptr)malloc_fn, (png_voidp)mem_ptr); *************** *** 659,665 **** } } while (png_libpng_ver[i++]); ! png_debug(1, "in png_write_init_3\n"); #ifdef PNG_SETJMP_SUPPORTED /* save jump buffer and error functions */ --- 659,665 ---- } } while (png_libpng_ver[i++]); ! png_debug(1, "in png_write_init_3"); #ifdef PNG_SETJMP_SUPPORTED /* save jump buffer and error functions */ *************** *** 713,719 **** png_uint_32 i; /* row counter */ png_bytepp rp; /* row pointer */ ! png_debug(1, "in png_write_rows\n"); if (png_ptr == NULL) return; --- 713,719 ---- png_uint_32 i; /* row counter */ png_bytepp rp; /* row pointer */ ! png_debug(1, "in png_write_rows"); if (png_ptr == NULL) return; *************** *** 738,744 **** if (png_ptr == NULL) return; ! png_debug(1, "in png_write_image\n"); #if defined(PNG_WRITE_INTERLACING_SUPPORTED) /* intialize interlace handling. If image is not interlaced, this will set pass to 1 */ --- 738,744 ---- if (png_ptr == NULL) return; ! png_debug(1, "in png_write_image"); #if defined(PNG_WRITE_INTERLACING_SUPPORTED) /* intialize interlace handling. If image is not interlaced, this will set pass to 1 */ *************** *** 763,769 **** { if (png_ptr == NULL) return; ! png_debug2(1, "in png_write_row (row %ld, pass %d)\n", png_ptr->row_number, png_ptr->pass); /* initialize transformations and other stuff if first time */ --- 763,769 ---- { if (png_ptr == NULL) return; ! png_debug2(1, "in png_write_row (row %ld, pass %d)", png_ptr->row_number, png_ptr->pass); /* initialize transformations and other stuff if first time */ *************** *** 877,888 **** png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->row_info.width); ! png_debug1(3, "row_info->color_type = %d\n", png_ptr->row_info.color_type); ! png_debug1(3, "row_info->width = %lu\n", png_ptr->row_info.width); ! png_debug1(3, "row_info->channels = %d\n", png_ptr->row_info.channels); ! png_debug1(3, "row_info->bit_depth = %d\n", png_ptr->row_info.bit_depth); ! png_debug1(3, "row_info->pixel_depth = %d\n", png_ptr->row_info.pixel_depth); ! png_debug1(3, "row_info->rowbytes = %lu\n", png_ptr->row_info.rowbytes); /* Copy user's row into buffer, leaving room for filter byte. */ png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row, --- 877,888 ---- png_ptr->row_info.rowbytes = PNG_ROWBYTES(png_ptr->row_info.pixel_depth, png_ptr->row_info.width); ! png_debug1(3, "row_info->color_type = %d", png_ptr->row_info.color_type); ! png_debug1(3, "row_info->width = %lu", png_ptr->row_info.width); ! png_debug1(3, "row_info->channels = %d", png_ptr->row_info.channels); ! png_debug1(3, "row_info->bit_depth = %d", png_ptr->row_info.bit_depth); ! png_debug1(3, "row_info->pixel_depth = %d", png_ptr->row_info.pixel_depth); ! png_debug1(3, "row_info->rowbytes = %lu", png_ptr->row_info.rowbytes); /* Copy user's row into buffer, leaving room for filter byte. */ png_memcpy_check(png_ptr, png_ptr->row_buf + 1, row, *************** *** 938,944 **** void PNGAPI png_set_flush(png_structp png_ptr, int nrows) { ! png_debug(1, "in png_set_flush\n"); if (png_ptr == NULL) return; png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); --- 938,944 ---- void PNGAPI png_set_flush(png_structp png_ptr, int nrows) { ! png_debug(1, "in png_set_flush"); if (png_ptr == NULL) return; png_ptr->flush_dist = (nrows < 0 ? 0 : nrows); *************** *** 950,956 **** { int wrote_IDAT; ! png_debug(1, "in png_write_flush\n"); if (png_ptr == NULL) return; /* We have already written out all of the data */ --- 950,956 ---- { int wrote_IDAT; ! png_debug(1, "in png_write_flush"); if (png_ptr == NULL) return; /* We have already written out all of the data */ *************** *** 1010,1016 **** png_voidp mem_ptr = NULL; #endif ! png_debug(1, "in png_destroy_write_struct\n"); if (png_ptr_ptr != NULL) { png_ptr = *png_ptr_ptr; --- 1010,1016 ---- png_voidp mem_ptr = NULL; #endif ! png_debug(1, "in png_destroy_write_struct"); if (png_ptr_ptr != NULL) { png_ptr = *png_ptr_ptr; *************** *** 1084,1090 **** png_free_ptr free_fn; #endif ! png_debug(1, "in png_write_destroy\n"); /* free any memory zlib uses */ deflateEnd(&png_ptr->zstream); --- 1084,1090 ---- png_free_ptr free_fn; #endif ! png_debug(1, "in png_write_destroy"); /* free any memory zlib uses */ deflateEnd(&png_ptr->zstream); *************** *** 1141,1147 **** void PNGAPI png_set_filter(png_structp png_ptr, int method, int filters) { ! png_debug(1, "in png_set_filter\n"); if (png_ptr == NULL) return; #if defined(PNG_MNG_FEATURES_SUPPORTED) --- 1141,1147 ---- void PNGAPI png_set_filter(png_structp png_ptr, int method, int filters) { ! png_debug(1, "in png_set_filter"); if (png_ptr == NULL) return; #if defined(PNG_MNG_FEATURES_SUPPORTED) *************** *** 1264,1270 **** { int i; ! png_debug(1, "in png_set_filter_heuristics\n"); if (png_ptr == NULL) return; if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) --- 1264,1270 ---- { int i; ! png_debug(1, "in png_set_filter_heuristics"); if (png_ptr == NULL) return; if (heuristic_method >= PNG_FILTER_HEURISTIC_LAST) *************** *** 1378,1384 **** void PNGAPI png_set_compression_level(png_structp png_ptr, int level) { ! png_debug(1, "in png_set_compression_level\n"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; --- 1378,1384 ---- void PNGAPI png_set_compression_level(png_structp png_ptr, int level) { ! png_debug(1, "in png_set_compression_level"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_LEVEL; *************** *** 1388,1394 **** void PNGAPI png_set_compression_mem_level(png_structp png_ptr, int mem_level) { ! png_debug(1, "in png_set_compression_mem_level\n"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; --- 1388,1394 ---- void PNGAPI png_set_compression_mem_level(png_structp png_ptr, int mem_level) { ! png_debug(1, "in png_set_compression_mem_level"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_MEM_LEVEL; *************** *** 1398,1404 **** void PNGAPI png_set_compression_strategy(png_structp png_ptr, int strategy) { ! png_debug(1, "in png_set_compression_strategy\n"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; --- 1398,1404 ---- void PNGAPI png_set_compression_strategy(png_structp png_ptr, int strategy) { ! png_debug(1, "in png_set_compression_strategy"); if (png_ptr == NULL) return; png_ptr->flags |= PNG_FLAG_ZLIB_CUSTOM_STRATEGY; *************** *** 1429,1435 **** void PNGAPI png_set_compression_method(png_structp png_ptr, int method) { ! png_debug(1, "in png_set_compression_method\n"); if (png_ptr == NULL) return; if (method != 8) --- 1429,1435 ---- void PNGAPI png_set_compression_method(png_structp png_ptr, int method) { ! png_debug(1, "in png_set_compression_method"); if (png_ptr == NULL) return; if (method != 8) *************** *** 1451,1457 **** png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr write_user_transform_fn) { ! png_debug(1, "in png_set_write_user_transform_fn\n"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_USER_TRANSFORM; --- 1451,1457 ---- png_set_write_user_transform_fn(png_structp png_ptr, png_user_transform_ptr write_user_transform_fn) { ! png_debug(1, "in png_set_write_user_transform_fn"); if (png_ptr == NULL) return; png_ptr->transformations |= PNG_USER_TRANSFORM; *************** *** 1506,1516 **** #endif #if defined(PNG_WRITE_FILLER_SUPPORTED) ! /* Get rid of filler (OR ALPHA) bytes, pack XRGB/RGBX/ARGB/RGBA into ! * RGB (4 channels -> 3 channels). The second parameter is not used. ! */ ! if (transforms & PNG_TRANSFORM_STRIP_FILLER) ! png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); #endif #if defined(PNG_WRITE_BGR_SUPPORTED) --- 1506,1516 ---- #endif #if defined(PNG_WRITE_FILLER_SUPPORTED) ! /* Pack XRGB/RGBX/ARGB/RGBA into * RGB (4 channels -> 3 channels) */ ! if (transforms & PNG_TRANSFORM_STRIP_FILLER_AFTER) ! png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); ! else if (transforms & PNG_TRANSFORM_STRIP_FILLER_BEFORE) ! png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE); #endif #if defined(PNG_WRITE_BGR_SUPPORTED) Index: pngwtran.c =================================================================== RCS file: /cvs/mushclient/pngwtran.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngwtran.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngwtran.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 18,24 **** void /* PRIVATE */ png_do_write_transformations(png_structp png_ptr) { ! png_debug(1, "in png_do_write_transformations\n"); if (png_ptr == NULL) return; --- 18,24 ---- void /* PRIVATE */ png_do_write_transformations(png_structp png_ptr) { ! png_debug(1, "in png_do_write_transformations"); if (png_ptr == NULL) return; *************** *** 86,92 **** void /* PRIVATE */ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) { ! png_debug(1, "in png_do_pack\n"); if (row_info->bit_depth == 8 && #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 86,92 ---- void /* PRIVATE */ png_do_pack(png_row_infop row_info, png_bytep row, png_uint_32 bit_depth) { ! png_debug(1, "in png_do_pack"); if (row_info->bit_depth == 8 && #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && *************** *** 212,218 **** void /* PRIVATE */ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) { ! png_debug(1, "in png_do_shift\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && #else --- 212,218 ---- void /* PRIVATE */ png_do_shift(png_row_infop row_info, png_bytep row, png_color_8p bit_depth) { ! png_debug(1, "in png_do_shift"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && #else *************** *** 336,342 **** void /* PRIVATE */ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_write_swap_alpha\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 336,342 ---- void /* PRIVATE */ png_do_write_swap_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_write_swap_alpha"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 424,430 **** void /* PRIVATE */ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_write_invert_alpha\n"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif --- 424,430 ---- void /* PRIVATE */ png_do_write_invert_alpha(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_write_invert_alpha"); #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL) #endif *************** *** 514,520 **** void /* PRIVATE */ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_write_intrapixel\n"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && --- 514,520 ---- void /* PRIVATE */ png_do_write_intrapixel(png_row_infop row_info, png_bytep row) { ! png_debug(1, "in png_do_write_intrapixel"); if ( #if defined(PNG_USELESS_TESTS_SUPPORTED) row != NULL && row_info != NULL && Index: pngwutil.c =================================================================== RCS file: /cvs/mushclient/pngwutil.c,v retrieving revision 1.1 retrieving revision 1.2 diff -c -r1.1 -r1.2 *** pngwutil.c 25 Aug 2008 02:47:14 -0000 1.1 --- pngwutil.c 25 Mar 2009 20:46:42 -0000 1.2 *************** *** 1,7 **** /* pngwutil.c - utilities to write a PNG file * ! * Last changed in libpng 1.2.30 [August 15, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) --- 1,7 ---- /* pngwutil.c - utilities to write a PNG file * ! * Last changed in libpng 1.2.34 [December 18, 2008] * For conditions of distribution and use, see copyright notice in png.h * Copyright (c) 1998-2008 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) *************** *** 96,102 **** { png_byte buf[8]; ! png_debug2(0, "Writing %s chunk, length = %lu\n", chunk_name, (unsigned long)length); if (png_ptr == NULL) return; --- 96,102 ---- { png_byte buf[8]; ! png_debug2(0, "Writing %s chunk, length = %lu", chunk_name, (unsigned long)length); if (png_ptr == NULL) return; *************** *** 392,398 **** png_byte buf[13]; /* buffer to store the IHDR info */ ! png_debug(1, "in png_write_IHDR\n"); /* Check that we have valid input data from the application info */ switch (color_type) { --- 392,398 ---- png_byte buf[13]; /* buffer to store the IHDR info */ ! png_debug(1, "in png_write_IHDR"); /* Check that we have valid input data from the application info */ switch (color_type) { *************** *** 569,575 **** png_colorp pal_ptr; png_byte buf[3]; ! png_debug(1, "in png_write_PLTE\n"); if (( #if defined(PNG_MNG_FEATURES_SUPPORTED) !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) && --- 569,575 ---- png_colorp pal_ptr; png_byte buf[3]; ! png_debug(1, "in png_write_PLTE"); if (( #if defined(PNG_MNG_FEATURES_SUPPORTED) !(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE) && *************** *** 595,601 **** } png_ptr->num_palette = (png_uint_16)num_pal; ! png_debug1(3, "num_palette = %d\n", png_ptr->num_palette); png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, (png_uint_32)(num_pal * 3)); --- 595,601 ---- } png_ptr->num_palette = (png_uint_16)num_pal; ! png_debug1(3, "num_palette = %d", png_ptr->num_palette); png_write_chunk_start(png_ptr, (png_bytep)png_PLTE, (png_uint_32)(num_pal * 3)); *************** *** 629,635 **** #ifdef PNG_USE_LOCAL_ARRAYS PNG_IDAT; #endif ! png_debug(1, "in png_write_IDAT\n"); /* Optimize the CMF field in the zlib stream. */ /* This hack of the zlib stream is compliant to the stream specification. */ --- 629,635 ---- #ifdef PNG_USE_LOCAL_ARRAYS PNG_IDAT; #endif ! png_debug(1, "in png_write_IDAT"); /* Optimize the CMF field in the zlib stream. */ /* This hack of the zlib stream is compliant to the stream specification. */ *************** *** 681,687 **** #ifdef PNG_USE_LOCAL_ARRAYS PNG_IEND; #endif ! png_debug(1, "in png_write_IEND\n"); png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, (png_size_t)0); png_ptr->mode |= PNG_HAVE_IEND; --- 681,687 ---- #ifdef PNG_USE_LOCAL_ARRAYS PNG_IEND; #endif ! png_debug(1, "in png_write_IEND"); png_write_chunk(png_ptr, (png_bytep)png_IEND, png_bytep_NULL, (png_size_t)0); png_ptr->mode |= PNG_HAVE_IEND; *************** *** 699,705 **** png_uint_32 igamma; png_byte buf[4]; ! png_debug(1, "in png_write_gAMA\n"); /* file_gamma is saved in 1/100,000ths */ igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5); png_save_uint_32(buf, igamma); --- 699,705 ---- png_uint_32 igamma; png_byte buf[4]; ! png_debug(1, "in png_write_gAMA"); /* file_gamma is saved in 1/100,000ths */ igamma = (png_uint_32)(file_gamma * 100000.0 + 0.5); png_save_uint_32(buf, igamma); *************** *** 715,721 **** #endif png_byte buf[4]; ! png_debug(1, "in png_write_gAMA\n"); /* file_gamma is saved in 1/100,000ths */ png_save_uint_32(buf, (png_uint_32)file_gamma); png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); --- 715,721 ---- #endif png_byte buf[4]; ! png_debug(1, "in png_write_gAMA"); /* file_gamma is saved in 1/100,000ths */ png_save_uint_32(buf, (png_uint_32)file_gamma); png_write_chunk(png_ptr, (png_bytep)png_gAMA, buf, (png_size_t)4); *************** *** 733,739 **** #endif png_byte buf[1]; ! png_debug(1, "in png_write_sRGB\n"); if (srgb_intent >= PNG_sRGB_INTENT_LAST) png_warning(png_ptr, "Invalid sRGB rendering intent specified"); --- 733,739 ---- #endif png_byte buf[1]; ! png_debug(1, "in png_write_sRGB"); if (srgb_intent >= PNG_sRGB_INTENT_LAST) png_warning(png_ptr, "Invalid sRGB rendering intent specified"); *************** *** 756,762 **** compression_state comp; int embedded_profile_len = 0; ! png_debug(1, "in png_write_iCCP\n"); comp.num_output_ptr = 0; comp.max_output_ptr = 0; --- 756,762 ---- compression_state comp; int embedded_profile_len = 0; ! png_debug(1, "in png_write_iCCP"); comp.num_output_ptr = 0; comp.max_output_ptr = 0; *************** *** 764,775 **** comp.input = NULL; comp.input_len = 0; ! if (name == NULL || (name_len = png_check_keyword(png_ptr, name, &new_name)) == 0) - { - png_warning(png_ptr, "Empty keyword in iCCP chunk"); return; - } if (compression_type != PNG_COMPRESSION_TYPE_BASE) png_warning(png_ptr, "Unknown compression type in iCCP chunk"); --- 764,772 ---- comp.input = NULL; comp.input_len = 0; ! if ((name_len = png_check_keyword(png_ptr, name, &new_name)) == 0) return; if (compression_type != PNG_COMPRESSION_TYPE_BASE) png_warning(png_ptr, "Unknown compression type in iCCP chunk"); *************** *** 835,847 **** int i; #endif ! png_debug(1, "in png_write_sPLT\n"); ! if (spalette->name == NULL || (name_len = png_check_keyword(png_ptr, spalette->name, &new_name))==0) ! { ! png_warning(png_ptr, "Empty keyword in sPLT chunk"); ! return; ! } /* make sure we include the NULL after the name */ png_write_chunk_start(png_ptr, (png_bytep)png_sPLT, --- 832,841 ---- int i; #endif ! png_debug(1, "in png_write_sPLT"); ! if ((name_len = png_check_keyword(png_ptr, spalette->name, &new_name))==0) ! return; /* make sure we include the NULL after the name */ png_write_chunk_start(png_ptr, (png_bytep)png_sPLT, *************** *** 912,918 **** png_byte buf[4]; png_size_t size; ! png_debug(1, "in png_write_sBIT\n"); /* make sure we don't depend upon the order of PNG_COLOR_8 */ if (color_type & PNG_COLOR_MASK_COLOR) { --- 906,912 ---- png_byte buf[4]; png_size_t size; ! png_debug(1, "in png_write_sBIT"); /* make sure we don't depend upon the order of PNG_COLOR_8 */ if (color_type & PNG_COLOR_MASK_COLOR) { *************** *** 969,1023 **** PNG_cHRM; #endif png_byte buf[32]; - png_uint_32 itemp; ! png_debug(1, "in png_write_cHRM\n"); ! /* each value is saved in 1/100,000ths */ ! if (white_x < 0 || white_x > 0.8 || white_y < 0 || white_y > 0.8 || ! white_x + white_y > 1.0) ! { ! png_warning(png_ptr, "Invalid cHRM white point specified"); ! #if !defined(PNG_NO_CONSOLE_IO) ! fprintf(stderr, "white_x=%f, white_y=%f\n", white_x, white_y); ! #endif ! return; ! } ! itemp = (png_uint_32)(white_x * 100000.0 + 0.5); ! png_save_uint_32(buf, itemp); ! itemp = (png_uint_32)(white_y * 100000.0 + 0.5); ! png_save_uint_32(buf + 4, itemp); ! if (red_x < 0 || red_y < 0 || red_x + red_y > 1.0) ! { ! png_warning(png_ptr, "Invalid cHRM red point specified"); ! return; ! } ! itemp = (png_uint_32)(red_x * 100000.0 + 0.5); ! png_save_uint_32(buf + 8, itemp); ! itemp = (png_uint_32)(red_y * 100000.0 + 0.5); ! png_save_uint_32(buf + 12, itemp); ! if (green_x < 0 || green_y < 0 || green_x + green_y > 1.0) ! { ! png_warning(png_ptr, "Invalid cHRM green point specified"); ! return; ! } ! itemp = (png_uint_32)(green_x * 100000.0 + 0.5); ! png_save_uint_32(buf + 16, itemp); ! itemp = (png_uint_32)(green_y * 100000.0 + 0.5); ! png_save_uint_32(buf + 20, itemp); ! if (blue_x < 0 || blue_y < 0 || blue_x + blue_y > 1.0) { ! png_warning(png_ptr, "Invalid cHRM blue point specified"); ! return; ! } ! itemp = (png_uint_32)(blue_x * 100000.0 + 0.5); ! png_save_uint_32(buf + 24, itemp); ! itemp = (png_uint_32)(blue_y * 100000.0 + 0.5); ! png_save_uint_32(buf + 28, itemp); ! png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); } #endif #ifdef PNG_FIXED_POINT_SUPPORTED --- 963,1004 ---- PNG_cHRM; #endif png_byte buf[32]; ! png_fixed_point int_white_x, int_white_y, int_red_x, int_red_y, ! int_green_x, int_green_y, int_blue_x, int_blue_y; ! png_debug(1, "in png_write_cHRM"); ! int_white_x = (png_uint_32)(white_x * 100000.0 + 0.5); ! int_white_y = (png_uint_32)(white_y * 100000.0 + 0.5); ! int_red_x = (png_uint_32)(red_x * 100000.0 + 0.5); ! int_red_y = (png_uint_32)(red_y * 100000.0 + 0.5); ! int_green_x = (png_uint_32)(green_x * 100000.0 + 0.5); ! int_green_y = (png_uint_32)(green_y * 100000.0 + 0.5); ! int_blue_x = (png_uint_32)(blue_x * 100000.0 + 0.5); ! int_blue_y = (png_uint_32)(blue_y * 100000.0 + 0.5); ! #if !defined(PNG_NO_CHECK_cHRM) ! if (png_check_cHRM_fixed(png_ptr, int_white_x, int_white_y, ! int_red_x, int_red_y, int_green_x, int_green_y, int_blue_x, int_blue_y)) ! #endif { ! /* each value is saved in 1/100,000ths */ ! ! png_save_uint_32(buf, int_white_x); ! png_save_uint_32(buf + 4, int_white_y); ! png_save_uint_32(buf + 8, int_red_x); ! png_save_uint_32(buf + 12, int_red_y); ! ! png_save_uint_32(buf + 16, int_green_x); ! png_save_uint_32(buf + 20, int_green_y); ! ! png_save_uint_32(buf + 24, int_blue_x); ! png_save_uint_32(buf + 28, int_blue_y); ! ! png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); ! } } #endif #ifdef PNG_FIXED_POINT_SUPPORTED *************** *** 1032,1076 **** #endif png_byte buf[32]; ! png_debug(1, "in png_write_cHRM\n"); /* each value is saved in 1/100,000ths */ ! if (white_x > 80000L || white_y > 80000L || white_x + white_y > 100000L) ! { ! png_warning(png_ptr, "Invalid fixed cHRM white point specified"); ! #if !defined(PNG_NO_CONSOLE_IO) ! fprintf(stderr, "white_x=%ld, white_y=%ld\n", (unsigned long)white_x, ! (unsigned long)white_y); #endif ! return; ! } png_save_uint_32(buf, (png_uint_32)white_x); png_save_uint_32(buf + 4, (png_uint_32)white_y); - if (red_x + red_y > 100000L) - { - png_warning(png_ptr, "Invalid cHRM fixed red point specified"); - return; - } png_save_uint_32(buf + 8, (png_uint_32)red_x); png_save_uint_32(buf + 12, (png_uint_32)red_y); - if (green_x + green_y > 100000L) - { - png_warning(png_ptr, "Invalid fixed cHRM green point specified"); - return; - } png_save_uint_32(buf + 16, (png_uint_32)green_x); png_save_uint_32(buf + 20, (png_uint_32)green_y); - if (blue_x + blue_y > 100000L) - { - png_warning(png_ptr, "Invalid fixed cHRM blue point specified"); - return; - } png_save_uint_32(buf + 24, (png_uint_32)blue_x); png_save_uint_32(buf + 28, (png_uint_32)blue_y); png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); } #endif #endif --- 1013,1039 ---- #endif png_byte buf[32]; ! png_debug(1, "in png_write_cHRM"); /* each value is saved in 1/100,000ths */ ! #if !defined(PNG_NO_CHECK_cHRM) ! if (png_check_cHRM_fixed(png_ptr, white_x, white_y, red_x, red_y, ! green_x, green_y, blue_x, blue_y)) #endif ! { png_save_uint_32(buf, (png_uint_32)white_x); png_save_uint_32(buf + 4, (png_uint_32)white_y); png_save_uint_32(buf + 8, (png_uint_32)red_x); png_save_uint_32(buf + 12, (png_uint_32)red_y); png_save_uint_32(buf + 16, (png_uint_32)green_x); png_save_uint_32(buf + 20, (png_uint_32)green_y); png_save_uint_32(buf + 24, (png_uint_32)blue_x); png_save_uint_32(buf + 28, (png_uint_32)blue_y); png_write_chunk(png_ptr, (png_bytep)png_cHRM, buf, (png_size_t)32); + } } #endif #endif *************** *** 1086,1092 **** #endif png_byte buf[6]; ! png_debug(1, "in png_write_tRNS\n"); if (color_type == PNG_COLOR_TYPE_PALETTE) { if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) --- 1049,1055 ---- #endif png_byte buf[6]; ! png_debug(1, "in png_write_tRNS"); if (color_type == PNG_COLOR_TYPE_PALETTE) { if (num_trans <= 0 || num_trans > (int)png_ptr->num_palette) *************** *** 1141,1147 **** #endif png_byte buf[6]; ! png_debug(1, "in png_write_bKGD\n"); if (color_type == PNG_COLOR_TYPE_PALETTE) { if ( --- 1104,1110 ---- #endif png_byte buf[6]; ! png_debug(1, "in png_write_bKGD"); if (color_type == PNG_COLOR_TYPE_PALETTE) { if ( *************** *** 1149,1155 **** (png_ptr->num_palette || (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) && #endif ! back->index > png_ptr->num_palette) { png_warning(png_ptr, "Invalid background palette index"); return; --- 1112,1118 ---- (png_ptr->num_palette || (!(png_ptr->mng_features_permitted & PNG_FLAG_MNG_EMPTY_PLTE))) && #endif ! back->index >= png_ptr->num_palette) { png_warning(png_ptr, "Invalid background palette index"); return; *************** *** 1195,1204 **** int i; png_byte buf[3]; ! png_debug(1, "in png_write_hIST\n"); if (num_hist > (int)png_ptr->num_palette) { ! png_debug2(3, "num_hist = %d, num_palette = %d\n", num_hist, png_ptr->num_palette); png_warning(png_ptr, "Invalid number of histogram entries specified"); return; --- 1158,1167 ---- int i; png_byte buf[3]; ! png_debug(1, "in png_write_hIST"); if (num_hist > (int)png_ptr->num_palette) { ! png_debug2(3, "num_hist = %d, num_palette = %d", num_hist, png_ptr->num_palette); png_warning(png_ptr, "Invalid number of histogram entries specified"); return; *************** *** 1235,1241 **** int kflag; int kwarn=0; ! png_debug(1, "in png_check_keyword\n"); *new_key = NULL; if (key == NULL || (key_len = png_strlen(key)) == 0) --- 1198,1204 ---- int kflag; int kwarn=0; ! png_debug(1, "in png_check_keyword"); *new_key = NULL; if (key == NULL || (key_len = png_strlen(key)) == 0) *************** *** 1244,1250 **** return ((png_size_t)0); } ! png_debug1(2, "Keyword to be checked is '%s'\n", key); *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2)); if (*new_key == NULL) --- 1207,1213 ---- return ((png_size_t)0); } ! png_debug1(2, "Keyword to be checked is '%s'", key); *new_key = (png_charp)png_malloc_warn(png_ptr, (png_uint_32)(key_len + 2)); if (*new_key == NULL) *************** *** 1303,1309 **** } } ! png_debug1(2, "Checking for multiple internal spaces in '%s'\n", kp); /* Remove multiple internal spaces. */ for (kflag = 0, dp = *new_key; *kp != '\0'; kp++) --- 1266,1272 ---- } } ! png_debug1(2, "Checking for multiple internal spaces in '%s'", kp); /* Remove multiple internal spaces. */ for (kflag = 0, dp = *new_key; *kp != '\0'; kp++) *************** *** 1338,1344 **** if (key_len > 79) { png_warning(png_ptr, "keyword length must be 1 - 79 characters"); ! new_key[79] = '\0'; key_len = 79; } --- 1301,1307 ---- if (key_len > 79) { png_warning(png_ptr, "keyword length must be 1 - 79 characters"); ! (*new_key)[79] = '\0'; key_len = 79; } *************** *** 1358,1369 **** png_size_t key_len; png_charp new_key; ! png_debug(1, "in png_write_tEXt\n"); ! if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) ! { ! png_warning(png_ptr, "Empty keyword in tEXt chunk"); return; - } if (text == NULL || *text == '\0') text_len = 0; --- 1321,1329 ---- png_size_t key_len; png_charp new_key; ! png_debug(1, "in png_write_tEXt"); ! if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0) return; if (text == NULL || *text == '\0') text_len = 0; *************** *** 1403,1409 **** png_charp new_key; compression_state comp; ! png_debug(1, "in png_write_zTXt\n"); comp.num_output_ptr = 0; comp.max_output_ptr = 0; --- 1363,1369 ---- png_charp new_key; compression_state comp; ! png_debug(1, "in png_write_zTXt"); comp.num_output_ptr = 0; comp.max_output_ptr = 0; *************** *** 1411,1419 **** comp.input = NULL; comp.input_len = 0; ! if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) { - png_warning(png_ptr, "Empty keyword in zTXt chunk"); png_free(png_ptr, new_key); return; } --- 1371,1378 ---- comp.input = NULL; comp.input_len = 0; ! if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0) { png_free(png_ptr, new_key); return; } *************** *** 1460,1482 **** PNG_iTXt; #endif png_size_t lang_len, key_len, lang_key_len, text_len; ! png_charp new_lang, new_key; png_byte cbuf[2]; compression_state comp; ! png_debug(1, "in png_write_iTXt\n"); comp.num_output_ptr = 0; comp.max_output_ptr = 0; comp.output_ptr = NULL; comp.input = NULL; ! if (key == NULL || (key_len = png_check_keyword(png_ptr, key, &new_key))==0) ! { ! png_warning(png_ptr, "Empty keyword in iTXt chunk"); return; ! } ! if (lang == NULL || (lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0) { png_warning(png_ptr, "Empty language field in iTXt chunk"); new_lang = NULL; --- 1419,1440 ---- PNG_iTXt; #endif png_size_t lang_len, key_len, lang_key_len, text_len; ! png_charp new_lang; ! png_charp new_key = NULL; png_byte cbuf[2]; compression_state comp; ! png_debug(1, "in png_write_iTXt"); comp.num_output_ptr = 0; comp.max_output_ptr = 0; comp.output_ptr = NULL; comp.input = NULL; ! if ((key_len = png_check_keyword(png_ptr, key, &new_key))==0) return; ! ! if ((lang_len = png_check_keyword(png_ptr, lang, &new_lang))==0) { png_warning(png_ptr, "Empty language field in iTXt chunk"); new_lang = NULL; *************** *** 1552,1558 **** #endif png_byte buf[9]; ! png_debug(1, "in png_write_oFFs\n"); if (unit_type >= PNG_OFFSET_LAST) png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); --- 1510,1516 ---- #endif png_byte buf[9]; ! png_debug(1, "in png_write_oFFs"); if (unit_type >= PNG_OFFSET_LAST) png_warning(png_ptr, "Unrecognized unit type for oFFs chunk"); *************** *** 1578,1591 **** png_charp new_purpose; int i; ! png_debug1(1, "in png_write_pCAL (%d parameters)\n", nparams); if (type >= PNG_EQUATION_LAST) png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1; ! png_debug1(3, "pCAL purpose length = %d\n", (int)purpose_len); units_len = png_strlen(units) + (nparams == 0 ? 0 : 1); ! png_debug1(3, "pCAL units length = %d\n", (int)units_len); total_len = purpose_len + units_len + 10; params_len = (png_uint_32p)png_malloc(png_ptr, --- 1536,1549 ---- png_charp new_purpose; int i; ! png_debug1(1, "in png_write_pCAL (%d parameters)", nparams); if (type >= PNG_EQUATION_LAST) png_warning(png_ptr, "Unrecognized equation type for pCAL chunk"); purpose_len = png_check_keyword(png_ptr, purpose, &new_purpose) + 1; ! png_debug1(3, "pCAL purpose length = %d", (int)purpose_len); units_len = png_strlen(units) + (nparams == 0 ? 0 : 1); ! png_debug1(3, "pCAL units length = %d", (int)units_len); total_len = purpose_len + units_len + 10; params_len = (png_uint_32p)png_malloc(png_ptr, *************** *** 1596,1607 **** for (i = 0; i < nparams; i++) { params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); ! png_debug2(3, "pCAL parameter %d length = %lu\n", i, (unsigned long) params_len[i]); total_len += (png_size_t)params_len[i]; } ! png_debug1(3, "pCAL total length = %d\n", (int)total_len); png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len); png_write_chunk_data(png_ptr, (png_bytep)new_purpose, (png_size_t)purpose_len); --- 1554,1565 ---- for (i = 0; i < nparams; i++) { params_len[i] = png_strlen(params[i]) + (i == nparams - 1 ? 0 : 1); ! png_debug2(3, "pCAL parameter %d length = %lu", i, (unsigned long) params_len[i]); total_len += (png_size_t)params_len[i]; } ! png_debug1(3, "pCAL total length = %d", (int)total_len); png_write_chunk_start(png_ptr, (png_bytep)png_pCAL, (png_uint_32)total_len); png_write_chunk_data(png_ptr, (png_bytep)new_purpose, (png_size_t)purpose_len); *************** *** 1637,1643 **** char buf[64]; png_size_t total_len; ! png_debug(1, "in png_write_sCAL\n"); buf[0] = (char)unit; #if defined(_WIN32_WCE) --- 1595,1601 ---- char buf[64]; png_size_t total_len; ! png_debug(1, "in png_write_sCAL"); buf[0] = (char)unit; #if defined(_WIN32_WCE) *************** *** 1662,1668 **** total_len += png_strlen(buf + total_len); #endif ! png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len); png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len); } #else --- 1620,1626 ---- total_len += png_strlen(buf + total_len); #endif ! png_debug1(3, "sCAL total length = %u", (unsigned int)total_len); png_write_chunk(png_ptr, (png_bytep)png_sCAL, (png_bytep)buf, total_len); } #else *************** *** 1677,1683 **** png_byte buf[64]; png_size_t wlen, hlen, total_len; ! png_debug(1, "in png_write_sCAL_s\n"); wlen = png_strlen(width); hlen = png_strlen(height); --- 1635,1641 ---- png_byte buf[64]; png_size_t wlen, hlen, total_len; ! png_debug(1, "in png_write_sCAL_s"); wlen = png_strlen(width); hlen = png_strlen(height); *************** *** 1692,1698 **** png_memcpy(buf + 1, width, wlen + 1); /* append the '\0' here */ png_memcpy(buf + wlen + 2, height, hlen); /* do NOT append the '\0' here */ ! png_debug1(3, "sCAL total length = %u\n", (unsigned int)total_len); png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len); } #endif --- 1650,1656 ---- png_memcpy(buf + 1, width, wlen + 1); /* append the '\0' here */ png_memcpy(buf + wlen + 2, height, hlen); /* do NOT append the '\0' here */ ! png_debug1(3, "sCAL total length = %u", (unsigned int)total_len); png_write_chunk(png_ptr, (png_bytep)png_sCAL, buf, total_len); } #endif *************** *** 1711,1717 **** #endif png_byte buf[9]; ! png_debug(1, "in png_write_pHYs\n"); if (unit_type >= PNG_RESOLUTION_LAST) png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); --- 1669,1675 ---- #endif png_byte buf[9]; ! png_debug(1, "in png_write_pHYs"); if (unit_type >= PNG_RESOLUTION_LAST) png_warning(png_ptr, "Unrecognized unit type for pHYs chunk"); *************** *** 1735,1741 **** #endif png_byte buf[7]; ! png_debug(1, "in png_write_tIME\n"); if (mod_time->month > 12 || mod_time->month < 1 || mod_time->day > 31 || mod_time->day < 1 || mod_time->hour > 23 || mod_time->second > 60) --- 1693,1699 ---- #endif png_byte buf[7]; ! png_debug(1, "in png_write_tIME"); if (mod_time->month > 12 || mod_time->month < 1 || mod_time->day > 31 || mod_time->day < 1 || mod_time->hour > 23 || mod_time->second > 60) *************** *** 1779,1785 **** png_size_t buf_size; ! png_debug(1, "in png_write_start_row\n"); buf_size = (png_size_t)(PNG_ROWBYTES( png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1); --- 1737,1743 ---- png_size_t buf_size; ! png_debug(1, "in png_write_start_row"); buf_size = (png_size_t)(PNG_ROWBYTES( png_ptr->usr_channels*png_ptr->usr_bit_depth, png_ptr->width) + 1); *************** *** 1879,1885 **** int ret; ! png_debug(1, "in png_write_finish_row\n"); /* next row */ png_ptr->row_number++; --- 1837,1843 ---- int ret; ! png_debug(1, "in png_write_finish_row"); /* next row */ png_ptr->row_number++; *************** *** 1988,1994 **** int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif ! png_debug(1, "in png_do_write_interlace\n"); /* we don't have to do anything on the last pass (6) */ #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && pass < 6) --- 1946,1952 ---- int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; #endif ! png_debug(1, "in png_do_write_interlace"); /* we don't have to do anything on the last pass (6) */ #if defined(PNG_USELESS_TESTS_SUPPORTED) if (row != NULL && row_info != NULL && pass < 6) *************** *** 2159,2165 **** int num_p_filters = (int)png_ptr->num_prev_filters; #endif ! png_debug(1, "in png_write_find_filter\n"); /* find out how many bytes offset each pixel is */ bpp = (row_info->pixel_depth + 7) >> 3; --- 2117,2123 ---- int num_p_filters = (int)png_ptr->num_prev_filters; #endif ! png_debug(1, "in png_write_find_filter"); /* find out how many bytes offset each pixel is */ bpp = (row_info->pixel_depth + 7) >> 3; *************** *** 2768,2775 **** void /* PRIVATE */ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) { ! png_debug(1, "in png_write_filtered_row\n"); ! png_debug1(2, "filter = %d\n", filtered_row[0]); /* set up the zlib input buffer */ png_ptr->zstream.next_in = filtered_row; --- 2726,2733 ---- void /* PRIVATE */ png_write_filtered_row(png_structp png_ptr, png_bytep filtered_row) { ! png_debug(1, "in png_write_filtered_row"); ! png_debug1(2, "filter = %d", filtered_row[0]); /* set up the zlib input buffer */ png_ptr->zstream.next_in = filtered_row; Index: stdafx.h =================================================================== RCS file: /cvs/mushclient/stdafx.h,v retrieving revision 1.115 retrieving revision 1.116 diff -c -r1.115 -r1.116 *** stdafx.h 22 Feb 2009 03:10:14 -0000 1.115 --- stdafx.h 23 Jun 2009 23:40:20 -0000 1.116 *************** *** 844,849 **** --- 844,852 ---- #define IsCTRLpressed() ( (GetKeyState(VK_CONTROL) & (1 << (sizeof(SHORT)*8-1))) != 0 ) #define IsSHIFTpressed() ( (GetKeyState(VK_SHIFT) & (1 << (sizeof(SHORT)*8-1))) != 0 ) + // ascii to double + int myAtoF(const char *z, double *pResult); + // colour stuff #define CLAMP(x) (((x) < 0) ? 0 : (x > 255) ? 255 : (x)) Index: xml_load_world.cpp =================================================================== RCS file: /cvs/mushclient/xml_load_world.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -c -r1.96 -r1.97 *** xml_load_world.cpp 14 Feb 2009 04:52:56 -0000 1.96 --- xml_load_world.cpp 23 Jun 2009 23:40:20 -0000 1.97 *************** *** 2231,2238 **** try { ! char *stopstring; ! double dActualVersion = strtod (MUSHCLIENT_VERSION, &stopstring); if (m_CurrentPlugin) ThrowErrorException ("Can only have one plugin per file"); --- 2231,2238 ---- try { ! double dActualVersion; ! myAtoF (MUSHCLIENT_VERSION, &dActualVersion); if (m_CurrentPlugin) ThrowErrorException ("Can only have one plugin per file"); Index: xmlparse.cpp =================================================================== RCS file: /cvs/mushclient/xmlparse.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -c -r1.25 -r1.26 *** xmlparse.cpp 4 May 2007 04:00:22 -0000 1.25 --- xmlparse.cpp 23 Jun 2009 23:40:20 -0000 1.26 *************** *** 1212,1218 **** const char * p = strValue; int iDots = 0; int iExponents = 0; - char *stopstring; // see if sign given if (*p == '-' || *p == '+') --- 1212,1217 ---- *************** *** 1252,1263 **** } // end of checking each character - dResult = strtod (strValue, &stopstring); ! if (dResult == HUGE_VAL || dResult == -HUGE_VAL) ThrowErrorException ("Value '%s' out of range in numeric attribute named '%s'" , (LPCTSTR) strValue, sName); if (dResult > dMaximum) ThrowErrorException ("Value '%s' too large in numeric attribute named '%s'. " --- 1251,1267 ---- } // end of checking each character ! myAtoF (strValue, &dResult); ! ! /* // myAtoF does not return myAtoF ! ! if (dResult == c || dResult == -HUGE_VAL) ThrowErrorException ("Value '%s' out of range in numeric attribute named '%s'" , (LPCTSTR) strValue, sName); + + */ if (dResult > dMaximum) ThrowErrorException ("Value '%s' too large in numeric attribute named '%s'. " Index: install/readme.txt =================================================================== RCS file: /cvs/mushclient/install/readme.txt,v retrieving revision 1.188 retrieving revision 1.190 diff -c -r1.188 -r1.190 *** install/readme.txt 23 Feb 2009 03:13:29 -0000 1.188 --- install/readme.txt 23 Jun 2009 23:40:20 -0000 1.190 *************** *** 1,7 **** ! MUSHclient version 4.40 ======================= ! Monday, 23rd February, 2009 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/ --- 1,7 ---- ! MUSHclient version 4.41 ======================= ! Wednesday, 24th June, 2009 Author: Nick Gammon Web support: http://www.gammon.com.au/forum/