summaryrefslogtreecommitdiff
path: root/codebook.c
Commit message (Collapse)AuthorAgeFilesLines
* Prevent out-of-bounds write in codebook decoding.Thomas Daede2018-03-151-9/+9
| | | | | Codebooks that are not an exact divisor of the partition size are now truncated to fit within the partition.
* floor0 code could potentially use a book where the number of vals itMonty2010-10-181-5/+9
| | | | | | | | | | | | | | | | | | | | needed to decode was not an integer number of dims wide. This caused it to overflow the output vector as the termination condition was in the outer loop of vorbis_book_decodev_set. None of the various vorbis_book_decodeXXXX calls internally guard against this case either, but in every other use the calling code does properly guard (and avoids putting more checks in the tight inner decode loop). For floor0, move the checks into the inner loop as there's little penalty for doing so. Add commentary indicating where guarding is done for each call variant. git-svn-id: https://svn.xiph.org/trunk/Tremor@17546 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Fix compiler warning.Tim Terriberry2010-10-161-1/+1
| | | | | | | codebook.c:87: warning: suggest parentheses around '-' inside '>>' git-svn-id: https://svn.xiph.org/trunk/Tremor@17540 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Additional codebook validity checks.Tim Terriberry2010-10-161-4/+16
| | | | | | | | | | Bail out of codebook loading early if the packet doesn't have enough data for the size of the codebooks it asked for. This doesn't in and of itself provide any additional security, but it does make peak heap usage on many invalid files smaller. git-svn-id: https://svn.xiph.org/trunk/Tremor@17539 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Port r17029 and r17050 from libvorbis.Tim Terriberry2010-10-141-6/+6
| | | | | | | Fix leak when aborting out of static_codebook unpack. Closes #1663. git-svn-id: https://svn.xiph.org/trunk/Tremor@17530 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Port r16597 from libvorbis.Tim Terriberry2010-10-141-0/+1
| | | | | | | Don't allow ordered codebooks with codeword lengths longer than 32 bits. git-svn-id: https://svn.xiph.org/trunk/Tremor@17528 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Port the rest of r16222 from libvorbis.Tim Terriberry2010-10-141-0/+1
| | | | | | | Commit additional hardening to setup packet decode. git-svn-id: https://svn.xiph.org/trunk/Tremor@17525 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Forward port r14602 from libvorbis.Tim Terriberry2010-10-131-1/+1
| | | | | | | Correctly handle the nonsensical codebook.dim==0 case. git-svn-id: https://svn.xiph.org/trunk/Tremor@17512 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Forward port r14064 from libvorbis.Tim Terriberry2010-10-131-0/+2
| | | | | | | Add checks/rejection for absurdly huge codebooks. git-svn-id: https://svn.xiph.org/trunk/Tremor@17511 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Convert Tremor to use libogg instead of its own internal libogg2.Tim Terriberry2010-08-311-1/+1
| | | | | | | | | | | | | This makes it easier to use Tremor as a drop-in replacement for libvorbis and reduces code size and overhead for those who don't want to use its built-in Ogg demuxer. This commit also backports all of the changes that have accumulated in libvorbis's vorbisfile implementation, with the exception of halfrate decoding and cross-lapped seeking. Those should not be too hard to add if someone really wants them. git-svn-id: https://svn.xiph.org/trunk/Tremor@17375 0101bb08-14d6-0310-b084-bc0e0c8e3800
* ...add same eop fix to Tremor mainlineMonty2007-06-231-1/+1
| | | | git-svn-id: https://svn.xiph.org/trunk/Tremor@13185 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Although not strictly a bug, decode_packed_entry_number() was not always Monty2007-06-231-1/+5
| | | | | | | | | forcing buffer eop correctly when it hit end of packet (as it was using look() not read()) git-svn-id: https://svn.xiph.org/trunk/Tremor@13180 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Tremor mainline succeptible to bug #340; corrected.Monty2007-06-221-91/+109
| | | | git-svn-id: https://svn.xiph.org/trunk/Tremor@13173 0101bb08-14d6-0310-b084-bc0e0c8e3800
* * Use the provided STIN macros so it builds on win32Zentaro Kavanagh2006-04-211-1/+1
| | | | | | * Add VS2005 project files git-svn-id: https://svn.xiph.org/trunk/Tremor@11211 0101bb08-14d6-0310-b084-bc0e0c8e3800
* move '#include "os.h"' to misc.h and j2005-05-101-1/+0
| | | | | | | | remove it where misc.h is included. git-svn-id: https://svn.xiph.org/trunk/Tremor@9257 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Update headers on source files for BSD license.Monty2002-09-031-1/+4
| | | | git-svn-id: https://svn.xiph.org/trunk/Tremor@3895 0101bb08-14d6-0310-b084-bc0e0c8e3800
* Put root level of Tremor in CVSMonty2002-09-021-0/+347
git-svn-id: https://svn.xiph.org/trunk/Tremor@3890 0101bb08-14d6-0310-b084-bc0e0c8e3800