[FFmpeg-cvslog] ccitt fax: fix some group3 1d files without EOL

Michael Niedermayer git at videolan.org
Fri Aug 17 03:07:02 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Aug 17 02:58:41 2012 +0200| [3a1ca240d97909a6c26a1c0ce599fd5027e760fe] | committer: Michael Niedermayer

ccitt fax: fix some group3 1d files without EOL

Fixes Ticket832

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

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

 libavcodec/faxcompr.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index e93926f..57e92be 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -279,6 +279,7 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
     int ret;
     int runsize= avctx->width + 2;
     int err = 0;
+    int has_eol;
 
     runs = av_malloc(runsize * sizeof(runs[0]));
     ref  = av_malloc(runsize * sizeof(ref[0]));
@@ -290,6 +291,7 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
     ref[1] = 0;
     ref[2] = 0;
     init_get_bits(&gb, src, srcsize*8);
+    has_eol = show_bits(&gb, 12) == 1;
     for(j = 0; j < height; j++){
         runend = runs + runsize;
         if(compr == TIFF_G4){
@@ -300,7 +302,7 @@ int ff_ccitt_unpack(AVCodecContext *avctx,
             }
         }else{
             int g3d1 = (compr == TIFF_G3) && !(opts & 1);
-            if(compr!=TIFF_CCITT_RLE && find_group3_syncmarker(&gb, srcsize*8) < 0)
+            if(compr!=TIFF_CCITT_RLE && has_eol && find_group3_syncmarker(&gb, srcsize*8) < 0)
                 break;
             if(compr==TIFF_CCITT_RLE || g3d1 || get_bits1(&gb))
                 ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs, runend);



More information about the ffmpeg-cvslog mailing list