diff options
author | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:08:25 +0000 |
---|---|---|
committer | Oded Shimon <ods15@ods15.dyndns.org> | 2006-10-02 06:08:25 +0000 |
commit | dac7b2f6dd085ade3786efbe45022b75cba5347e (patch) | |
tree | 723e9c8887893b474918cc372a5bb0dca7347bc3 /libavcodec/vorbis_enc.c | |
parent | 7e4221fd6b074d5ffe20ddbe3077d934124c1b68 (diff) | |
download | ffmpeg-streaming-dac7b2f6dd085ade3786efbe45022b75cba5347e.zip ffmpeg-streaming-dac7b2f6dd085ade3786efbe45022b75cba5347e.tar.gz |
Original Commit: r77 | ods15 | 2006-09-29 15:12:56 +0300 (Fri, 29 Sep 2006) | 2 lines
fix for book==-1 in floor
Originally committed as revision 6482 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vorbis_enc.c')
-rw-r--r-- | libavcodec/vorbis_enc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index 7cbd571..95f383c 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -773,13 +773,14 @@ static void floor_encode(venc_context_t * venc, floor_t * fc, PutBitContext * pb put_bits(pb, book->entries[cval].len, book->entries[cval].codeword); } for (k = 0; k < c->dim; k++) { - codebook_t * book = &venc->codebooks[c->books[cval & (csub-1)]]; + int book = c->books[cval & (csub-1)]; int entry = coded[counter++]; cval >>= c->subclass; + if (book == -1) continue; if (entry == -1) entry = 0; - assert(entry < book->nentries); + assert(entry < venc->codebooks[book].nentries); assert(entry >= 0); - put_bits(pb, book->entries[entry].len, book->entries[entry].codeword); + put_bits(pb, venc->codebooks[book].entries[entry].len, venc->codebooks[book].entries[entry].codeword); } } |