static int gif_read_packet(AVFormatContext * s1,

                           AVPacket * pkt)

{

    GifState *s = s1->priv_data;

    int ret;



    ret = gif_parse_next_image(s);

    if (ret < 0)

        return ret;



    /* XXX: avoid copying */

    if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) {

        return AVERROR(EIO);

    }

    pkt->stream_index = 0;

    memcpy(pkt->data, s->image_buf, s->screen_width * s->screen_height * 3);

    return 0;

}

static int gif_read_packet(AVFormatContext * s1,

                           AVPacket * pkt)

{

    GifState *s = s1->priv_data;

    int ret;



    ret = gif_parse_next_image(s);

    if (ret < 0)

        return ret;



    

    if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) {

        return AVERROR(EIO);

    }

    pkt->stream_index = 0;

    memcpy(pkt->data, s->image_buf, s->screen_width * s->screen_height * 3);

    return 0;

}

    return 0;     return 0;     return 0;     return 0;     GifState *s = s1->priv_data;     return 0; static int gif_read_packet(AVFormatContext * s1,                            AVPacket * pkt)     GifState *s = s1->priv_data;     int ret;     ret = gif_parse_next_image(s);     if (ret < 0)         return ret;     if (av_new_packet(pkt, s->screen_width * s->screen_height * 3)) {         return AVERROR(EIO);     pkt->stream_index = 0;     memcpy(pkt->data, s->image_buf, s->screen_width * s->screen_height * 3);     return 0;     GifState *s = s1->priv_data;     return 0;
static int FUNC_0(AVFormatContext * VAR_0,

                           AVPacket * VAR_1)

{

    GifState *s = VAR_0->priv_data;

    int VAR_2;



    VAR_2 = gif_parse_next_image(s);

    if (VAR_2 < 0)

        return VAR_2;



    

    if (av_new_packet(VAR_1, s->screen_width * s->screen_height * 3)) {

        return AVERROR(EIO);

    }

    VAR_1->stream_index = 0;

    memcpy(VAR_1->data, s->image_buf, s->screen_width * s->screen_height * 3);

    return 0;

}

static int FUNC_0(AVFormatContext * VAR_0,
AVPacket * VAR_1)
{ GifState *s = VAR_0->priv_data; int VAR_2; VAR_2 = gif_parse_next_image(s); if (VAR_2 < 0)
return VAR_2; if (av_new_packet(VAR_1, s->screen_width * s->screen_height * 3)) { return AVERROR(EIO); } VAR_1->stream_index = 0; memcpy(VAR_1->data, s->image_buf, s->screen_width * s->screen_height * 3); return 0; }