Original Commit: r34 | ods15 | 2006-09-22 18:46:57 +0300 (Fri, 22 Sep 2006) | 2 lines
authorOded Shimon <ods15@ods15.dyndns.org>
Mon, 2 Oct 2006 05:56:14 +0000 (05:56 +0000)
committerOded Shimon <ods15@ods15.dyndns.org>
Mon, 2 Oct 2006 05:56:14 +0000 (05:56 +0000)
off by one in codebook header

Originally committed as revision 6442 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavcodec/vorbis_enc.c

index f62ebe9..8f8f2b5 100644 (file)
@@ -376,7 +376,7 @@ static void put_codebook_header(PutBitContext * pb, codebook_t * cb) {
 
         for (i = 0; i < cb->nentries; i++) {
             if (sparse) put_bits(pb, 1, !!cb->entries[i].len);
-            if (cb->entries[i].len) put_bits(pb, 5, cb->entries[i].len);
+            if (cb->entries[i].len) put_bits(pb, 5, cb->entries[i].len - 1);
         }
     }