Revision 8da5d3dc

View differences:

libavcodec/faxcompr.c
269 269

  
270 270
int ff_ccitt_unpack(AVCodecContext *avctx,
271 271
                       const uint8_t *src, int srcsize,
272
                       uint8_t *dst, int height, int stride, enum TiffCompr compr)
272
                       uint8_t *dst, int height, int stride, enum TiffCompr compr, int opts)
273 273
{
274 274
    int j;
275 275
    GetBitContext gb;
......
293 293
                return -1;
294 294
            }
295 295
        }else{
296
            int g3d1 = (compr == TIFF_G3) && !(opts & 1);
296 297
            if(compr!=TIFF_CCITT_RLE && find_group3_syncmarker(&gb, srcsize*8) < 0)
297 298
                break;
298
            if(compr==TIFF_CCITT_RLE || get_bits1(&gb))
299
            if(compr==TIFF_CCITT_RLE || g3d1 || get_bits1(&gb))
299 300
                ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs, runend);
300 301
            else
301 302
                ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref);
libavcodec/faxcompr.h
40 40
 */
41 41
int ff_ccitt_unpack(AVCodecContext *avctx,
42 42
                       const uint8_t *src, int srcsize,
43
                       uint8_t *dst, int height, int stride, enum TiffCompr compr);
43
                       uint8_t *dst, int height, int stride, enum TiffCompr compr, int opts);
44 44

  
45 45
#endif /* AVCODEC_FAXCOMPR_H */
libavcodec/tiff.c
146 146
                src2[i] = ff_reverse[src[i]];
147 147
        }
148 148
        memset(src2+size, 0, FF_INPUT_BUFFER_PADDING_SIZE);
149
        if(s->compr == TIFF_G3 && !(s->fax_opts & 1))
150
            s->compr = TIFF_CCITT_RLE;
151 149
        switch(s->compr){
152 150
        case TIFF_CCITT_RLE:
153 151
        case TIFF_G3:
154 152
        case TIFF_G4:
155
            ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride, s->compr);
153
            ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride, s->compr, s->fax_opts);
156 154
            break;
157 155
        }
158 156
        av_free(src2);

Also available in: Unified diff