Hello community,

here is the log from the commit of package plib for openSUSE:Factory checked in 
at 2012-01-12 15:27:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/plib (Old)
 and      /work/SRC/openSUSE:Factory/.plib.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "plib", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:Factory/plib/plib.changes        2011-11-28 
12:55:57.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.plib.new/plib.changes   2012-01-12 
15:27:07.000000000 +0100
@@ -1,0 +2,13 @@
+Fri Dec 30 13:14:12 CET 2011 - [email protected]
+
+- Applied patches from plib SVN
+  * Fixed segfault in puInput when pasting empty buffer
+  * Fixed heap corruption when removing puInputBase objects
+  * Fixed various puSlider issues
+
+-------------------------------------------------------------------
+Sun Nov 27 15:23:03 UTC 2011 - [email protected]
+
+- Remove redundant/unwanted tags/section (cf. specfile guidelines)
+
+-------------------------------------------------------------------

New:
----
  plib-1.8.5-commit2136-segfault.patch
  plib-1.8.5-commit2139-slider.patch
  plib-1.8.5-commit2140-slider.patch
  plib-1.8.5-commit2154-segfault.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ plib.spec ++++++
--- /var/tmp/diff_new_pack.Jp7mBN/_old  2012-01-12 15:27:14.000000000 +0100
+++ /var/tmp/diff_new_pack.Jp7mBN/_new  2012-01-12 15:27:14.000000000 +0100
@@ -15,7 +15,6 @@
 # Please submit bugfixes or comments via http://bugs.opensuse.org/
 #
 
-# norootforbuild
 
 
 Name:           plib
@@ -24,12 +23,16 @@
 Release:        0
 Group:          System/Libraries
 License:        LGPL v2.1 or later
-Url:            http://plib.sourceforge.net/
+URL:            http://plib.sourceforge.net/
 Summary:        A collection of useful Game libraries
 Source:         %{name}-%{version}.tar.bz2
 Patch0:         %{name}-%{version}-shared.patch
 Patch1:         %{name}-%{version}-intptr_t.patch
 Patch2:         %{name}-%{version}-strncat.patch
+Patch3:         plib-1.8.5-commit2136-segfault.patch
+Patch4:         plib-1.8.5-commit2139-slider.patch
+Patch5:         plib-1.8.5-commit2140-slider.patch
+Patch6:         plib-1.8.5-commit2154-segfault.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -46,14 +49,7 @@
 
 o SSG - A Simple Scene Graph API built on top of OpenGL
 
-
-
-Authors:
---------
-    Steve Baker <[email protected]>
-
 %package devel
-License:        LGPL v2.1 or later
 Requires:       plib = %{version}
 Summary:        A collection of useful Game libraries
 Group:          System/Libraries
@@ -75,17 +71,15 @@
 
 o SSG - A Simple Scene Graph API built on top of OpenGL
 
-
-
-Authors:
---------
-    Steve Baker <[email protected]>
-
 %prep
 %setup -q
 %patch0
 %patch1
 %patch2
+%patch3
+%patch4
+%patch5
+%patch6
 
 %build
 autoreconf -fiv

++++++ plib-1.8.5-commit2136-segfault.patch ++++++
Fixing the delete display_text statement in puInputBase (e-mail from Melchior 
Franz, Wed 12/17/2008 6:12 PM)
--- src/pui/pu.h        2008/11/10 15:40:28     2135
+++ src/pui/pu.h        2008/12/18 04:19:29     2136
@@ -1445,31 +1445,31 @@
   virtual void setValue ( puValue *pv )
   {
     puValue::setValue ( pv ) ;
-    delete displayed_text ;  displayed_text = NULL ;
+    delete [] displayed_text ;  displayed_text = NULL ;
   }
 
   virtual void setValue ( int   i )
   {
     puValue::setValue ( i ) ;
-    delete displayed_text ;  displayed_text = NULL ;
+    delete [] displayed_text ;  displayed_text = NULL ;
   }
 
   virtual void setValue ( float f )
   {
     puValue::setValue ( f ) ;
-    delete displayed_text ;  displayed_text = NULL ;
+    delete [] displayed_text ;  displayed_text = NULL ;
   }
 
   virtual void setValue ( const char *s )
   {
     puValue::setValue ( s ) ;
-    delete displayed_text ;  displayed_text = NULL ;
+    delete [] displayed_text ;  displayed_text = NULL ;
   }
 
   virtual void setValue ( bool b )
   {
     puValue::setValue ( b ) ;
-    delete displayed_text ;  displayed_text = NULL ;
+    delete [] displayed_text ;  displayed_text = NULL ;
   }
 } ;
 
++++++ plib-1.8.5-commit2139-slider.patch ++++++
Allow slider fractions of 1.0 -- don't force them to 0.9 -- in puSlider.cxx 
(e-mail by Melchior Franz on Mon 1/12/2009 1:23 PM
--- src/pui/puSlider.cxx        2009/01/13 15:42:26     2138
+++ src/pui/puSlider.cxx        2009/01/13 15:47:52     2139
@@ -131,8 +131,11 @@
       next_value = 0.5f ;
     else
     {
-      next_value = ( (float)coord - (float)abox.min[sd] - (float)sz * 
slider_fraction / 2.0f ) /
-                   ( (float) sz * (1.0f - slider_fraction) ) ;
+      if ( slider_fraction >= 1.0f )
+        next_value = 0 ;
+      else
+        next_value = ( (float)coord - (float)abox.min[sd] - (float)sz * 
slider_fraction / 2.0f ) /
+                     ( (float) sz * (1.0f - slider_fraction) ) ;
     }
 
     next_value = (next_value < 0.0f) ? 0.0f : (next_value > 1.0f) ? 1.0f : 
next_value ;
@@ -177,7 +180,7 @@
   int sz = abox.max [i] - abox.min [i] ;  // Size of slider box, in pixels
   float minf = 10.0f / sz ;               // fraction that makes a 10px handle
 
-  slider_fraction = (f<minf) ? minf : (f>=1.0f) ? 0.9f : f ;
+  slider_fraction = (f<minf) ? minf : (f>1.0f) ? 1.0f : f ;
   puPostRefresh () ;
 }
 
++++++ plib-1.8.5-commit2140-slider.patch ++++++
Changes to fix the "puauxLargeInput" widget per e-mail from Melchior Franz 
dated Mon 1/12/2009 1:28 PM:
* don't write outside of the text box
* fix slider fractions
* remove redundant code
--- src/puAux/puAuxLargeInput.cxx       2009/01/13 15:47:52     2139
+++ src/puAux/puAuxLargeInput.cxx       2009/01/13 17:02:41     2140
@@ -31,14 +31,13 @@
 
 static void puaLargeInputHandleRightSlider ( puObject *slider )
 {
-  float val = ((puaScrollBar *)slider)->getMaxValue () - slider->getFloatValue 
() ;
-
   puaLargeInput* text = (puaLargeInput*) slider->getUserData () ;
-  //int lines_in_window = text->getLinesInWindow () ; 
+  int lines_in_window = text->getLinesInWindow () ; 
   int num_lines = text->getNumLines () ;
+  float val = 1 - slider->getFloatValue () ;
 
   if ( num_lines > 0 )
-    text->setTopLineInWindow ( int ( val + 0.5f ) ) ;
+    text->setTopLineInWindow ( int ( val * ( num_lines - lines_in_window ) + 
0.5f ) ) ;
 }
 
 // Private function from the widget itself
@@ -75,39 +74,32 @@
   type |= PUCLASS_LARGEINPUT ;
   num_lines = 1 ;
   slider_width = sl_width ;
-  lines_in_window = ( h - (bottom_slider?slider_width:0) ) /
-                    ( getLegendFont().getStringHeight() + 
getLegendFont().getStringDescender() + 1 ) ;
   top_line_in_window = 0 ;
   max_width = 0 ;
-
   widget = this ;
 
   // Set up the widgets
 
   frame = new puFrame ( 0, 0, w, h );
 
+  int bottom_slider_width = 0;
   if ( wrap_text )
     bottom_slider = (puSlider *)NULL ;
   else
   {
     bottom_slider = new puSlider ( 0, 0, w - slider_width, FALSE, slider_width 
) ,
     bottom_slider->setValue ( 0.0f ) ;   // All the way to the left
-//    bottom_slider->setDelta(0.1f); // Commented out CBModes and Deltas for 
these sliders to increase response time and to ensure the sliders react 
properly even when first selected - JCJ 13 Jun 2002
-    bottom_slider->setSliderFraction (1.0f) ;
-//    bottom_slider->setCBMode( PUSLIDER_DELTA );
+    bottom_slider_width = slider_width;
   }
 
-  right_slider = new puaScrollBar ( w - slider_width, 
(bottom_slider?slider_width:0),
-                                    h - (bottom_slider?slider_width:0), 
arrows, TRUE, slider_width ) ,
+  right_slider = new puaScrollBar ( w - slider_width, bottom_slider_width,
+                                    h - bottom_slider_width, arrows, TRUE, 
slider_width ) ,
   right_slider->setValue ( 1.0f ) ;    // All the way to the top
-//  right_slider->setDelta(0.1f);
-  right_slider->setSliderFraction (1.0f) ;
-  right_slider->setStepSize ( 1.0f ) ;
-//  right_slider->setCBMode( PUSLIDER_DELTA );
   right_slider->setUserData ( this ) ;
   right_slider->setCallback ( puaLargeInputHandleRightSlider ) ;
 
   setValue ( "\n" ) ;
+  setSize ( w, h ) ;
 
   close  () ;
   reveal () ;
@@ -115,29 +107,40 @@
 
 void puaLargeInput::setSize ( int w, int h )
 {
-  // Resize the frame:
-  frame->setSize ( w, h ) ;
+  int bottom_slider_width = bottom_slider ? slider_width : 0 ;
+  int line_size = legendFont.getStringHeight() + 
legendFont.getStringDescender() + 1 ;
+  if ( !w ) w = 1 ;
+  if ( !h ) h = 1 ;
 
-  // Resize and reposition the sliders
   if ( bottom_slider )
     bottom_slider->setSize ( w - slider_width, slider_width ) ;
   else  // No bottom slider, rewrap the text
     wrapText () ;
 
-  right_slider->setPosition ( w-slider_width, (bottom_slider?slider_width:0) ) 
;
-  right_slider->setSize ( slider_width, h-(bottom_slider?slider_width:0) ) ;
+  right_slider->setPosition ( w - slider_width, bottom_slider_width ) ;
+  right_slider->setSize ( slider_width, h - bottom_slider_width ) ;
 
-  lines_in_window = ( h - (bottom_slider?slider_width:0) ) /
-                    ( getLegendFont().getStringHeight() + 
getLegendFont().getStringDescender() + 1 ) ;
+  lines_in_window = ( h - bottom_slider_width ) / line_size ;
+  frame->setSize ( w, h ) ;
+  setSliders () ;
+}
 
-  int line_size = legendFont.getStringHeight () +     // Height of a line
-                  legendFont.getStringDescender() ;  // of text, in pixels
-  int box_height = ( abox.max[1] - abox.min[1] - slider_width ) / line_size ;
-  int right_slider_max = num_lines - lines_in_window + 1 ;
-  if ( right_slider_max < 1 ) right_slider_max = 1 ;
+void puaLargeInput::setSliders ( void )
+{
+  int w = abox.max[0] - abox.min[0] ;
+  int h = abox.max[1] - abox.min[1] ;
+  int line_size = legendFont.getStringHeight() + 
legendFont.getStringDescender() + 1 ;
+  int bottom_slider_width = bottom_slider ? slider_width : 0 ;
+  int box_width = w - slider_width ;                         // in pixels
+  int box_height = ( h - bottom_slider_width ) / line_size ; // in lines
+
+  if ( bottom_slider ) {
+    float frac = box_width > max_width ? 1 : float(box_width) / max_width ;
+    bottom_slider->setSliderFraction ( frac ) ;
+  }
 
-  right_slider->setSliderFraction ( float(box_height) / 
float(right_slider_max) ) ;
-  right_slider->setMaxValue ( float(right_slider_max) ) ;
+  right_slider->setSliderFraction ( float(box_height) / num_lines ) ;
+  right_slider->setValue ( 1.0f - float(top_line_in_window) / num_lines ) ;
 }
 
 void puaLargeInput::setSelectRegion ( int s, int e )
@@ -297,14 +300,12 @@
 
 void  puaLargeInput::setValue ( const char *s )
 {
-  if ( bottom_slider ) bottom_slider->setSliderFraction ( 0.0f ) ;
-  right_slider->setSliderFraction ( 0.0f ) ;
-
   if ( s == NULL )
   {
     puValue::setValue ( "\n" ) ;
     num_lines = 0 ;
     cursor_position = select_start_position = select_end_position = 0 ;
+    setSliders () ;
     return ;
   }
 
@@ -353,26 +354,8 @@
   if ( max_width < line_width )
     max_width = line_width ;
 
-  // Set slider fractions
-
-  int line_size = legendFont.getStringHeight () +     // Height of a line
-                  legendFont.getStringDescender() ;  // of text, in pixels
-
-  int box_width = abox.max[0] - abox.min[0] - slider_width ;   // Input box 
width, in pixels
-  int box_height = ( abox.max[1] - abox.min[1] - slider_width ) / line_size ;
-                                                // Input box height, in lines
-
-  if ( bottom_slider )
-    bottom_slider->setSliderFraction ( float(box_width) / float(max_width) ) ;
-
-  int right_slider_max = num_lines - lines_in_window + 1 ;
-  if ( right_slider_max < 1 ) right_slider_max = 1 ;
-
-  right_slider->setSliderFraction ( float(box_height) / 
float(right_slider_max) ) ;
-  right_slider->setMaxValue ( float(right_slider_max) ) ;
-
-  // Normalize the cursors
   normalizeCursors () ;
+  setSliders () ;
 }
 
 
@@ -397,14 +380,14 @@
     int ywidget = abox.min[1] + dy ;
 
     int line_size = legendFont.getStringHeight () +         // Height of a line
-                    legendFont.getStringDescender() + 1 ;  // of text, in 
pixels
+                    legendFont.getStringDescender() + 1 ;   // of text, in 
pixels
 
     int xx = int(legendFont.getFloatStringWidth ( " " )) ;
     int yy = int( abox.max[1] - abox.min[1] - legendFont.getStringHeight () * 
1.5f ) ;
 
-    int box_width = abox.max[0] - abox.min[0] - slider_width - xx - xx ;   // 
Input box width, in pixels
-    int box_height = ( abox.max[1] - abox.min[1] - 
(bottom_slider?slider_width:0) ) / line_size ;
-                                                  // Input box height, in lines
+    int box_width = abox.max[0] - abox.min[0] - slider_width - xx - xx ;    // 
Input box width, in pixels
+    int box_height = ( abox.max[1] - abox.min[1] - 
(bottom_slider?slider_width:0) - 1
+                     - legendFont.getStringHeight () * 0.5f ) / line_size ; // 
Input box height, in lines
 
     float bottom_value = bottom_slider ? bottom_slider->getFloatValue () : 
0.0f ;
 
@@ -416,8 +399,6 @@
     int end_lin      // Position on line count of bottom of window, in lines
                 = top_line_in_window + box_height ;
 
-   /* Removed IF statement to permit highlighting to remain even when widget 
not active - JCJ 13 Jun 2002 */
-    
     char *val = bottom_slider ? getStringValue () : getDisplayedText () ;
 
     // Highlight the select area
@@ -544,7 +525,7 @@
             val = end_of_line + 1 ;
             end_of_line = strchr (val, '\n') ;     // Just go to the next line
           }
-          else if ( line_count <= end_lin )        // Within the window, draw 
it
+          else if ( line_count < end_lin )        // Within the window, draw it
           {
             char temp_char = *end_of_line ;   // Temporary holder for last 
char on line
 
@@ -620,7 +601,7 @@
             val = end_of_line + 1 ;
             end_of_line = strchr (val, '\n') ;     // On to the next line
           }
-          else if ( line_count > end_lin )        // Have gone beyond window, 
end process
+          else if ( line_count >= end_lin )        // Have gone beyond window, 
end process
             end_of_line = NULL ;
 
           line_count++ ;
--- src/puAux/puAux.h   2009/01/13 15:47:52     2139
+++ src/puAux/puAux.h   2009/01/13 17:02:41     2140
@@ -155,6 +155,7 @@
 
   void normalizeCursors ( void ) ;
   void removeSelectRegion ( void ) ;
+  void setSliders ( void ) ;
 
   void wrapText ( void ) ;
 
++++++ plib-1.8.5-commit2154-segfault.patch ++++++
[Plib-devel] [PATCH] puInput: don't segfault if one pastes an empty(NULL) paste 
buffer -- e-mail from Melchior Franz dated Mon 2/9/2009 7:42 AM
--- src/pui/puInput.cxx 2009/02/09 14:53:20     2153
+++ src/pui/puInput.cxx 2009/02/09 14:55:47     2154
@@ -369,6 +369,9 @@
 
       case 0x16 /* ^V */ : /* Paste buffer into text */
         {
+          if ( ! puGetPasteBuffer () )
+            break ;
+
           if ( select_start_position != select_end_position )
             removeSelectRegion () ;
 
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to