Ticket #1995: packbits.diff

File packbits.diff, 900 bytes (added by ami_stuff, 13 years ago)
  • libavcodec/tiff.c

    diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c
    index d5fba7e..fca7922 100644
    a b static int tiff_unpack_strip(TiffContext *s, uint8_t *dst, int stride,  
    530530            src += width;
    531531            break;
    532532        case TIFF_PACKBITS:
     533            if (s->fill_order) {
     534                int i;
     535                av_fast_padded_malloc(&s->deinvert_buf, &s->deinvert_buf_size, size);
     536                 if (!s->deinvert_buf)
     537                     return AVERROR(ENOMEM);
     538                 for (i = 0; i < width; i++)
     539                     s->deinvert_buf[i] = ff_reverse[src[i]];
     540                 src = s->deinvert_buf;
     541                 ssrc = src;
     542            }
    533543            for (pixels = 0; pixels < width;) {
    534544                if (ssrc + size - src < 2) {
    535545                    av_log(s->avctx, AV_LOG_ERROR, "Read went out of bounds\n");