comparison faxcompr.c @ 10272:cc02e912d20e libavcodec

Fix decoding of TIFF CCITT RLE compressed data. This fixes issue 1417.
author kostya
date Sat, 26 Sep 2009 05:48:50 +0000
parents 0dce4fe6e6f3
children 370d05e51d90
comparison
equal deleted inserted replaced
10271:4c1259af2fce 10272:cc02e912d20e
291 av_free(runs); 291 av_free(runs);
292 av_free(ref); 292 av_free(ref);
293 return -1; 293 return -1;
294 } 294 }
295 }else{ 295 }else{
296 if(find_group3_syncmarker(&gb, srcsize*8) < 0) 296 if(compr!=TIFF_CCITT_RLE && find_group3_syncmarker(&gb, srcsize*8) < 0)
297 break; 297 break;
298 if(compr==TIFF_CCITT_RLE || get_bits1(&gb)) 298 if(compr==TIFF_CCITT_RLE || get_bits1(&gb))
299 ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs, runend); 299 ret = decode_group3_1d_line(avctx, &gb, avctx->width, runs, runend);
300 else 300 else
301 ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref); 301 ret = decode_group3_2d_line(avctx, &gb, avctx->width, runs, runend, ref);
302 if(compr==TIFF_CCITT_RLE && (get_bits_count(&gb) & 7))
303 skip_bits(&gb, 8 - (get_bits_count(&gb) & 7));
302 } 304 }
303 if(ret < 0){ 305 if(ret < 0){
304 put_line(dst, stride, avctx->width, ref); 306 put_line(dst, stride, avctx->width, ref);
305 }else{ 307 }else{
306 put_line(dst, stride, avctx->width, runs); 308 put_line(dst, stride, avctx->width, runs);