From 8bf7a510b92695e4ef4dc26e3b039049e6ddcbd9 Mon Sep 17 00:00:00 2001 From: "Reynaldo H. Verdejo Pinochet" Date: Sun, 12 Apr 2009 21:48:43 +0000 Subject: [PATCH] Fix wrong size computation for buffer. Patch is part of netgem's changeset. Originally committed as revision 18477 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/dvbsubdec.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index a10f97bb2f..e2e8d5f913 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -439,9 +439,9 @@ static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len, int run_length; int pixels_read = 0; - init_get_bits(&gb, *srcbuf, buf_size << 8); + init_get_bits(&gb, *srcbuf, buf_size << 3); - while (get_bits_count(&gb) < (buf_size << 8) && pixels_read < dbuf_len) { + while (get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) { bits = get_bits(&gb, 2); if (bits) { @@ -544,9 +544,9 @@ static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len, int run_length; int pixels_read = 0; - init_get_bits(&gb, *srcbuf, buf_size << 8); + init_get_bits(&gb, *srcbuf, buf_size << 3); - while (get_bits_count(&gb) < (buf_size << 8) && pixels_read < dbuf_len) { + while (get_bits_count(&gb) < buf_size << 3 && pixels_read < dbuf_len) { bits = get_bits(&gb, 4); if (bits) {