[xiph-commits] r11043 - trunk/theora/lib

giles at svn.xiph.org giles at svn.xiph.org
Mon Mar 20 16:03:22 PST 2006


Author: giles
Date: 2006-03-20 16:03:20 -0800 (Mon, 20 Mar 2006)
New Revision: 11043

Modified:
   trunk/theora/lib/scan.c
Log:
Check for row and column out-of-bounds before verifying ChangedLocalsPtr 
in PixelLineSearch() to protect against dereferencing the pointer when
we're outside the allocated area. This was causing a segfault with some
files under current OpenBSD.


Modified: trunk/theora/lib/scan.c
===================================================================
--- trunk/theora/lib/scan.c	2006-03-20 21:40:07 UTC (rev 11042)
+++ trunk/theora/lib/scan.c	2006-03-21 00:03:20 UTC (rev 11043)
@@ -1479,12 +1479,12 @@
                              ogg_uint32_t * line_length ){
   /* Exit if the pixel does not qualify or we have fallen off the edge
      of either the image plane or the row. */
-  if ( ((*ChangedLocalsPtr) <= 1) ||
-       ((*ChangedLocalsPtr) >= 6) ||
-       (RowNumber < 0) ||
+  if ( (RowNumber < 0) ||
        (RowNumber >= ppi->PlaneHeight) ||
        (ColNumber < 0) ||
-       (ColNumber >= ppi->PlaneWidth) ){
+       (ColNumber >= ppi->PlaneWidth) ||
+       ((*ChangedLocalsPtr) <= 1) ||
+       ((*ChangedLocalsPtr) >= 6) ){
     /* If not then it isn't part of any line. */
     return;
   }



More information about the commits mailing list