On Mon, May 09, 2011 at 09:59:20PM +0200, Stefano Sabatini wrote:
> Fix decoding of file b.tif, trac issue #168.
> ---
> libavcodec/tiff.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
> index 1ecdc94..ae4c68e 100644
> --- a/libavcodec/tiff.c
> +++ b/libavcodec/tiff.c
> @@ -162,13 +162,20 @@ static int tiff_unpack_strip(TiffContext *s, uint8_t*
> dst, int stride, const uin
> return ret;
> }
> for(line = 0; line < lines; line++){
> + int i;
> +
> if(src - ssrc > size){
> av_log(s->avctx, AV_LOG_ERROR, "Source data overread\n");
> return -1;
> }
> switch(s->compr){
> case TIFF_RAW:
> - memcpy(dst, src, width);
> + if (!s->fill_order) {
> + memcpy(dst, src, width);
> + } else {
> + for (i = 0; i < width; i++)
> + dst[i] = av_reverse[src[i]];
> + }
> src += width;
> break;
> case TIFF_PACKBITS:
> --
looks ok (though you can move "int i;" declaration inside else{} block IMO)
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel