[FFmpeg-cvslog] avcodec/vorbis: fix decoding of single element huffman trees

Michael Niedermayer git at videolan.org
Thu Mar 27 13:03:05 CET 2014


ffmpeg | branch: release/2.2 | Michael Niedermayer <michaelni at gmx.at> | Sat Mar  8 05:13:05 2014 +0100| [2c566744c41e075ac4b882137105e73b2c1a6870] | committer: Michael Niedermayer

avcodec/vorbis: fix decoding of single element huffman trees

Fixes Ticket2893

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 742d8601031fc69748f62fe7c5164a22a0751021)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2c566744c41e075ac4b882137105e73b2c1a6870
---

 libavcodec/vorbis.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/vorbis.c b/libavcodec/vorbis.c
index 6eb765d..05f18b4 100644
--- a/libavcodec/vorbis.c
+++ b/libavcodec/vorbis.c
@@ -85,6 +85,11 @@ int ff_vorbis_len2vlc(uint8_t *bits, uint32_t *codes, unsigned num)
 
     ++p;
 
+    for (i = p; (bits[i] == 0) && (i < num); ++i)
+        ;
+    if (i == num)
+        return 0;
+
     for (; p < num; ++p) {
         if (bits[p] > 32)
              return 1;



More information about the ffmpeg-cvslog mailing list