#include <stdlib.h>
#include "avcodec.h"
+#include "internal.h"
#include "lcl.h"
#include <zlib.h>
int zret; // Zlib return code
int max_size = deflateBound(&c->zstream, avctx->width * avctx->height * 3);
- if (!pkt->data &&
- (ret = av_new_packet(pkt, max_size)) < 0) {
- av_log(avctx, AV_LOG_ERROR, "Error allocating packet of size %d.\n", max_size);
+ if ((ret = ff_alloc_packet2(avctx, pkt, max_size)) < 0)
return ret;
- }
*p = *pict;
p->pict_type= AV_PICTURE_TYPE_I;
.init = encode_init,
.encode2 = encode_frame,
.close = encode_end,
- .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_BGR24, PIX_FMT_NONE },
- .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
+ .pix_fmts = (const enum PixelFormat[]) { PIX_FMT_BGR24, PIX_FMT_NONE },
+ .long_name = NULL_IF_CONFIG_SMALL("LCL (LossLess Codec Library) ZLIB"),
};