head 1.1; access; symbols pkgsrc-2013Q2:1.1.0.44 pkgsrc-2013Q2-base:1.1 pkgsrc-2012Q4:1.1.0.42 pkgsrc-2012Q4-base:1.1 pkgsrc-2011Q4:1.1.0.40 pkgsrc-2011Q4-base:1.1 pkgsrc-2011Q2:1.1.0.38 pkgsrc-2011Q2-base:1.1 pkgsrc-2009Q4:1.1.0.36 pkgsrc-2009Q4-base:1.1 pkgsrc-2008Q4:1.1.0.34 pkgsrc-2008Q4-base:1.1 pkgsrc-2008Q3:1.1.0.32 pkgsrc-2008Q3-base:1.1 cube-native-xorg:1.1.0.30 cube-native-xorg-base:1.1 pkgsrc-2008Q2:1.1.0.28 pkgsrc-2008Q2-base:1.1 pkgsrc-2008Q1:1.1.0.26 pkgsrc-2008Q1-base:1.1 pkgsrc-2007Q4:1.1.0.24 pkgsrc-2007Q4-base:1.1 pkgsrc-2007Q3:1.1.0.22 pkgsrc-2007Q3-base:1.1 pkgsrc-2007Q2:1.1.0.20 pkgsrc-2007Q2-base:1.1 pkgsrc-2007Q1:1.1.0.18 pkgsrc-2007Q1-base:1.1 pkgsrc-2006Q4:1.1.0.16 pkgsrc-2006Q4-base:1.1 pkgsrc-2006Q3:1.1.0.14 pkgsrc-2006Q3-base:1.1 pkgsrc-2006Q2:1.1.0.12 pkgsrc-2006Q2-base:1.1 pkgsrc-2006Q1:1.1.0.10 pkgsrc-2006Q1-base:1.1 pkgsrc-2005Q4:1.1.0.8 pkgsrc-2005Q4-base:1.1 pkgsrc-2005Q3:1.1.0.6 pkgsrc-2005Q3-base:1.1 pkgsrc-2005Q2:1.1.0.4 pkgsrc-2005Q2-base:1.1 pkgsrc-2005Q1:1.1.0.2; locks; strict; comment @# @; 1.1 date 2005.05.01.22.06.21; author salo; state dead; branches 1.1.2.1; next ; 1.1.2.1 date 2005.05.01.22.06.21; author salo; state Exp; branches; next ; desc @@ 1.1 log @file patch-dm was initially added on branch pkgsrc-2005Q1. @ text @@ 1.1.2.1 log @Pullup ticket 475 - requested by Mark Davies security fix for kdelibs3 Patch provided by the submitter. Module Name: pkgsrc Committed By: markd Date: Sun May 1 04:35:40 UTC 2005 Modified Files: pkgsrc/x11/kdelibs3: Makefile distinfo pkgsrc/x11/kdelibs3/patches: patch-dc patch-dd patch-de Added Files: pkgsrc/x11/kdelibs3/patches: patch-di patch-dk patch-dl patch-dm patch-dn Log Message: Apply the official KDE patches for CAN-2005-1046. http://www.kde.org/info/security/advisory-20050421-1.txt Bump PKGREVISION. @ text @a0 76 $NetBSD$ --- kimgio/ico.cpp.orig 2004-06-23 05:36:40.000000000 +1200 +++ kimgio/ico.cpp @@@@ -113,6 +113,8 @@@@ namespace // closest size match precedes everything else if ( std::abs( int( lhs.width - size ) ) < std::abs( int( rhs.width - size ) ) ) return true; + else if ( std::abs( int( lhs.width - size ) ) > + std::abs( int( rhs.width - size ) ) ) return false; else if ( colors == 0 ) { // high/true color requested @@@@ -144,17 +146,31 @@@@ namespace header.biBitCount != 8 && header.biBitCount != 24 && header.biBitCount != 32 ) ) return false; - unsigned colors = header.biBitCount >= 24 ? - 0 : header.biClrUsed ? - header.biClrUsed : 1 << header.biBitCount; + unsigned paletteSize, paletteEntries; + + if (header.biBitCount > 8) + { + paletteEntries = 0; + paletteSize = 0; + } + else + { + paletteSize = (1 << header.biBitCount); + paletteEntries = paletteSize; + if (header.biClrUsed && header.biClrUsed < paletteSize) + paletteEntries = header.biClrUsed; + } + // Always create a 32-bit image to get the mask right + // Note: this is safe as rec.width, rec.height are bytes icon.create( rec.width, rec.height, 32 ); if ( icon.isNull() ) return false; icon.setAlphaBuffer( true ); - QMemArray< QRgb > colorTable( 1 << header.biBitCount ); + QMemArray< QRgb > colorTable( paletteSize ); + colorTable.fill( QRgb( 0 ) ); - for ( unsigned i = 0; i < colors; ++i ) + for ( unsigned i = 0; i < paletteEntries; ++i ) { unsigned char rgb[ 4 ]; stream.readRawBytes( reinterpret_cast< char* >( &rgb ), @@@@ -163,6 +179,7 @@@@ namespace } unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4; + unsigned char* buf = new unsigned char[ bpl ]; unsigned char** lines = icon.jumpTable(); for ( unsigned y = rec.height; !stream.atEnd() && y--; ) @@@@ -265,11 +282,13 @@@@ extern "C" void kimgio_ico_read( QImageI stream >> rec; icons.push_back( rec ); } - IconList::const_iterator selected = - requestedIndex >= 0 ? - std::min( icons.begin() + requestedIndex, icons.end() ) : - std::min_element( icons.begin(), icons.end(), + IconList::const_iterator selected; + if (requestedIndex >= 0) { + selected = std::min( icons.begin() + requestedIndex, icons.end() ); + } else { + selected = std::min_element( icons.begin(), icons.end(), LessDifference( requestedSize, requestedColors ) ); + } if ( stream.atEnd() || selected == icons.end() || offset + selected->offset > io->ioDevice()->size() ) return; @