int palette_has_changed = 0;
if (c->avctx->pix_fmt == AV_PIX_FMT_PAL8) {
- int size;
+ buffer_size_t size;
const uint8_t *pal = av_packet_get_side_data(avpkt, AV_PKT_DATA_PALETTE, &size);
if (pal && size == AVPALETTE_SIZE) {
return AVERROR_UNKNOWN;
}
- if ((ret = ff_reget_buffer(avctx, frame)) < 0)
+ if ((ret = ff_reget_buffer(avctx, frame, 0)) < 0)
return ret;
if (ret != Z_DATA_ERROR) {
}
c->frame = av_frame_alloc();
+ if (!c->frame)
+ return AVERROR(ENOMEM);
return 0;
}
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};