1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

dvbsubdec: Fix variable increments & checking in dvbsub_read_*bit_string()

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
JULIAN GARDNER 2011-10-14 14:52:33 +02:00 committed by Michael Niedermayer
parent 337496980e
commit eea064aea6

View File

@ -532,14 +532,14 @@ static int dvbsub_read_2bit_string(uint8_t *destbuf, int dbuf_len,
}
}
} else if (bits == 1) {
pixels_read += 2;
if (map_table)
bits = map_table[0];
else
bits = 0;
if (pixels_read <= dbuf_len) {
*destbuf++ = bits;
run_length = 2;
while (run_length-- > 0 && pixels_read < dbuf_len) {
*destbuf++ = bits;
pixels_read++;
}
} else {
(*srcbuf) += (get_bits_count(&gb) + 7) >> 3;
@ -656,14 +656,14 @@ static int dvbsub_read_4bit_string(uint8_t *destbuf, int dbuf_len,
}
}
} else if (bits == 1) {
pixels_read += 2;
if (map_table)
bits = map_table[0];
else
bits = 0;
if (pixels_read <= dbuf_len) {
*destbuf++ = bits;
run_length = 2;
while (run_length-- > 0 && pixels_read < dbuf_len) {
*destbuf++ = bits;
pixels_read++;
}
} else {
if (map_table)