[xiph-cvs] cvs commit: vorbis/lib floor0.c

Monty xiphmont at xiph.org
Fri Feb 9 18:07:00 PST 2001



xiphmont    01/02/09 18:07:00

  Modified:    lib      floor0.c
  Log:
  Guard against getting an invalid LSP codebook in decode if the packet
  is corrupt.
  
  Monty

Revision  Changes    Path
1.37      +2 -2      vorbis/lib/floor0.c

Index: floor0.c
===================================================================
RCS file: /usr/local/cvsroot/vorbis/lib/floor0.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- floor0.c	2001/02/02 03:51:56	1.36
+++ floor0.c	2001/02/10 02:06:59	1.37
@@ -11,7 +11,7 @@
  ********************************************************************
 
  function: floor backend 0 implementation
- last mod: $Id: floor0.c,v 1.36 2001/02/02 03:51:56 xiphmont Exp $
+ last mod: $Id: floor0.c,v 1.37 2001/02/10 02:06:59 xiphmont Exp $
 
  ********************************************************************/
 
@@ -398,7 +398,7 @@
     int booknum=oggpack_read(&vb->opb,_ilog(info->numbooks));
     float *lsp=alloca(sizeof(float)*look->m);
 
-    if(booknum!=-1){
+    if(booknum!=-1 && booknum<info->numbooks){ /* be paranoid */
       backend_lookup_state *be=vb->vd->backend_state;
       codebook *b=be->fullbooks+info->books[booknum];
       float last=0.f;

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'cvs-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.



More information about the commits mailing list