*data_size = sizeof(AVFrame); *(AVFrame*)data = s->current_frame;
s->current_frame.data[0] = NULL;
static int ipvideo_decode_frame(AVCodecContext *avctx,                                void *data, int *data_size,                                uint8_t *buf, int buf_size){    IpvideoContext *s = avctx->priv_data;    AVPaletteControl *palette_control = (AVPaletteControl *)avctx->extradata;    if (palette_control->palette_changed) {        /* load the new palette and reset the palette control */        ipvideo_new_palette(s, palette_control->palette);        palette_control->palette_changed = 0;    }    s->decoding_map = buf;    s->buf = buf + s->decoding_map_size;    s->size = buf_size - s->decoding_map_size;    if (avctx->get_buffer(avctx, &s->current_frame)) {        printf ("  Interplay Video: get_buffer() failed\n");        return -1;    }    ipvideo_decode_opcodes(s);    /* release the last frame if it is allocated */    if (s->first_frame)        s->first_frame = 0;    else        avctx->release_buffer(avctx, &s->last_frame);    /* shuffle frames */    s->last_frame = s->current_frame;    *data_size = sizeof(AVFrame);    *(AVFrame*)data = s->current_frame;    /* report that the buffer was completely consumed */    return buf_size;}