[PATCH] fix access to unallocated memory

"[email protected]" <[email protected]>
Newsgroups gmane.comp.multimedia.ogg.theora.devel
Message-ID <[email protected]>
Hi,

this trivial patch reorders to tests to avoid an off by 1 access.

Cheers

_______________________________________________
theora-dev mailing list
[email protected]
http://lists.xiph.org/mailman/listinfo/theora-dev
libtheora-unallocated-memory.diff (text/x-patch, 464 B)
--- libtheora-1.0beta2/lib/enc/frarray.c	2007-09-22 09:38:14.000000000 +0100
+++ libtheora-1.0beta2/lib/enc/frarray.c.new	2008-04-06 10:50:02.000000000 +0100
@@ -213,7 +213,7 @@
     /* Now code the block flags. */
     for ( i = 0; i < BListIndex; ) {
       run_count = 0;
-      while ( (cpi->BlockCodedFlags[i] == val) && (i < BListIndex) ) {
+      while ( (i < BListIndex) && (cpi->BlockCodedFlags[i] == val) ) {
         i++;
         run_count++;
       }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.