[FFmpeg-cvslog] avcodec/dvbsubdec: Fix 8bit non_mod case

Michael Niedermayer git at videolan.org
Tue Nov 11 23:15:01 CET 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Jul 31 13:25:43 2014 +0200| [e0c36f58257f015296a391c5bac763f1aec9a6e2] | committer: Michael Niedermayer

avcodec/dvbsubdec: Fix 8bit non_mod case

Untested, i failed to find a sample which triggers this case

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

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

 libavcodec/dvbsubdec.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c
index b1f953e..0b373e9 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++;
+                    }
                 }
             }
         }



More information about the ffmpeg-cvslog mailing list