[FFmpeg-cvslog] vorbisdec: Make sure blocksize is not set to an invalid value.

Michael Niedermayer git at videolan.org
Thu Jan 5 01:13:03 CET 2012


ffmpeg | branch: release/0.9 | Michael Niedermayer <michaelni at gmx.at> | Wed Jan  4 19:22:20 2012 +0100| [89bd49b25c4cb34f5d871e5292f86662bc858589] | committer: Michael Niedermayer

vorbisdec: Make sure blocksize is not set to an invalid value.

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

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

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

 libavcodec/vorbisdec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c
index 03ecc38..32ef750 100644
--- a/libavcodec/vorbisdec.c
+++ b/libavcodec/vorbisdec.c
@@ -935,12 +935,12 @@ static int vorbis_parse_id_hdr(vorbis_context *vc)
     vc->bitrate_minimum = get_bits_long(gb, 32);
     bl0 = get_bits(gb, 4);
     bl1 = get_bits(gb, 4);
-    vc->blocksize[0] = (1 << bl0);
-    vc->blocksize[1] = (1 << bl1);
     if (bl0 > 13 || bl0 < 6 || bl1 > 13 || bl1 < 6 || bl1 < bl0) {
         av_log(vc->avccontext, AV_LOG_ERROR, " Vorbis id header packet corrupt (illegal blocksize). \n");
         return AVERROR_INVALIDDATA;
     }
+    vc->blocksize[0] = (1 << bl0);
+    vc->blocksize[1] = (1 << bl1);
     vc->win[0] = ff_vorbis_vwin[bl0 - 6];
     vc->win[1] = ff_vorbis_vwin[bl1 - 6];
 



More information about the ffmpeg-cvslog mailing list