static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,

                           const uint8_t *src, int size, int width, int lines)

{

    int i, ret = 0;

    int line;

    uint8_t *src2 = av_malloc((unsigned)size +

                              AV_INPUT_BUFFER_PADDING_SIZE);



    if (!src2) {

        av_log(s->avctx, AV_LOG_ERROR,

               "Error allocating temporary buffer\n");

        return AVERROR(ENOMEM);

    }



    if (!s->fill_order) {

        memcpy(src2, src, size);

    } else {

        for (i = 0; i < size; i++)

            src2[i] = ff_reverse[src[i]];

    }

    memset(src2 + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);

    ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride,

                          s->compr, s->fax_opts);

    if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8)

        for (line = 0; line < lines; line++) {

            horizontal_fill(s->bpp, dst, 1, dst, 0, width, 0);

            dst += stride;

        }

    av_free(src2);

    return ret;

}

static int tiff_unpack_fax(TiffContext *s, uint8_t *dst, int stride,

                           const uint8_t *src, int size, int width, int lines)

{

    int i, ret = 0;

    int line;

    uint8_t *src2 = av_malloc((unsigned)size +

                              AV_INPUT_BUFFER_PADDING_SIZE);



    if (!src2) {

        av_log(s->avctx, AV_LOG_ERROR,

               "Error allocating temporary buffer\n");

        return AVERROR(ENOMEM);

    }



    if (!s->fill_order) {

        memcpy(src2, src, size);

    } else {

        for (i = 0; i < size; i++)

            src2[i] = ff_reverse[src[i]];

    }

    memset(src2 + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);

    ret = ff_ccitt_unpack(s->avctx, src2, size, dst, lines, stride,

                          s->compr, s->fax_opts);

    if (s->bpp < 8 && s->avctx->pix_fmt == AV_PIX_FMT_PAL8)

        for (line = 0; line < lines; line++) {

            horizontal_fill(s->bpp, dst, 1, dst, 0, width, 0);

            dst += stride;

        }

    av_free(src2);

    return ret;

}

    uint8_t *src2 = av_malloc((unsigned)size +                               AV_INPUT_BUFFER_PADDING_SIZE);     av_free(src2);
static int FUNC_0(TiffContext *VAR_0, uint8_t *VAR_1, int VAR_2,

                           const uint8_t *VAR_3, int VAR_4, int VAR_5, int VAR_6)

{

    int VAR_7, VAR_8 = 0;

    int VAR_9;

    uint8_t *src2 = av_malloc((unsigned)VAR_4 +

                              AV_INPUT_BUFFER_PADDING_SIZE);



    if (!src2) {

        av_log(VAR_0->avctx, AV_LOG_ERROR,

               "Error allocating temporary buffer\n");

        return AVERROR(ENOMEM);

    }



    if (!VAR_0->fill_order) {

        memcpy(src2, VAR_3, VAR_4);

    } else {

        for (VAR_7 = 0; VAR_7 < VAR_4; VAR_7++)

            src2[VAR_7] = ff_reverse[VAR_3[VAR_7]];

    }

    memset(src2 + VAR_4, 0, AV_INPUT_BUFFER_PADDING_SIZE);

    VAR_8 = ff_ccitt_unpack(VAR_0->avctx, src2, VAR_4, VAR_1, VAR_6, VAR_2,

                          VAR_0->compr, VAR_0->fax_opts);

    if (VAR_0->bpp < 8 && VAR_0->avctx->pix_fmt == AV_PIX_FMT_PAL8)

        for (VAR_9 = 0; VAR_9 < VAR_6; VAR_9++) {

            horizontal_fill(VAR_0->bpp, VAR_1, 1, VAR_1, 0, VAR_5, 0);

            VAR_1 += VAR_2;

        }

    av_free(src2);

    return VAR_8;

}

static int FUNC_0(TiffContext *VAR_0, uint8_t *VAR_1, int VAR_2,
const uint8_t *VAR_3, int VAR_4, int VAR_5, int VAR_6)
{ int VAR_7, VAR_8 = 0; int VAR_9; uint8_t *src2 = av_malloc((unsigned)VAR_4 +
AV_INPUT_BUFFER_PADDING_SIZE); if (!src2) { av_log(VAR_0->avctx, AV_LOG_ERROR,
"Error allocating temporary buffer\n"); return AVERROR(ENOMEM); } if (!VAR_0->fill_order) { memcpy(src2, VAR_3, VAR_4); } else { for (VAR_7 = 0; VAR_7 < VAR_4; VAR_7++) src2[VAR_7] = ff_reverse[VAR_3[VAR_7]]; } memset(src2 + VAR_4, 0, AV_INPUT_BUFFER_PADDING_SIZE); VAR_8 = ff_ccitt_unpack(VAR_0->avctx, src2, VAR_4, VAR_1, VAR_6, VAR_2,
VAR_0->compr, VAR_0->fax_opts); if (VAR_0->bpp < 8 && VAR_0->avctx->pix_fmt == AV_PIX_FMT_PAL8)
for (VAR_9 = 0; VAR_9 < VAR_6; VAR_9++) { horizontal_fill(VAR_0->bpp, VAR_1, 1, VAR_1, 0, VAR_5, 0); VAR_1 += VAR_2; } av_free(src2); return VAR_8; }