aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-07-31 13:25:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-11-11 22:57:01 +0100
commite0c36f58257f015296a391c5bac763f1aec9a6e2 (patch)
tree9a9fcc57fa735e4ac286c6bf0280e9138b45684a
parent2813dabdd4964ab37f8b0cea42f49531931c9006 (diff)
downloadffmpeg-e0c36f58257f015296a391c5bac763f1aec9a6e2.tar.gz
avcodec/dvbsubdec: Fix 8bit non_mod case
Untested, i failed to find a sample which triggers this case Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/dvbsubdec.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index b1f953e8f9..0b373e976c 100644
--- a/libavcodec/dvbsubdec.c
+++ b/libavcodec/dvbsubdec.c
@@ -741,11 +741,13 @@ static int dvbsub_read_8bit_string(uint8_t *destbuf, int dbuf_len,
if (non_mod == 1 && bits == 1)
pixels_read += run_length;
- if (map_table)
- bits = map_table[bits];
- else while (run_length-- > 0 && pixels_read < dbuf_len) {
- *destbuf++ = bits;
- pixels_read++;
+ else {
+ if (map_table)
+ bits = map_table[bits];
+ while (run_length-- > 0 && pixels_read < dbuf_len) {
+ *destbuf++ = bits;
+ pixels_read++;
+ }
}
}
}