uint32_t size;
int offset = 0;
+ if (avpkt->size < 2)
+ return AVERROR_INVALIDDATA;
+
bytestream2_init(&c->stream, avpkt->data, avpkt->size);
if ((ret = ff_get_buffer(avctx, frame, 0)) < 0)
c->frame = av_mallocz(avctx->width * avctx->height);
c->prev_frame = av_mallocz(avctx->width * avctx->height);
- if (!c->frame || !c->prev_frame) {
- av_freep(&c->frame);
- av_freep(&c->prev_frame);
+ if (!c->frame || !c->prev_frame)
return AVERROR(ENOMEM);
- }
return 0;
}
return 0;
}
-AVCodec ff_vb_decoder = {
+const AVCodec ff_vb_decoder = {
.name = "vb",
.long_name = NULL_IF_CONFIG_SMALL("Beam Software VB"),
.type = AVMEDIA_TYPE_VIDEO,
.close = decode_end,
.decode = decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
+ .caps_internal = FF_CODEC_CAP_INIT_CLEANUP,
};