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
release/0.6
Reynaldo H. Verdejo Pinochet 16 years ago
parent 5137235e0c
commit 8bf7a510b9
  1. 8
      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) {

Loading…
Cancel
Save