palette_set = bytestream_get_byte(&buf);
buf += 5;
+ if (sprite_offset > buf_size)
+ return AVERROR_INVALIDDATA;
+
/* read new sprites introduced in this frame */
buf = avpkt->data + sprite_offset;
while (sprite_count--) {
return 0;
}
-AVCodec ff_cdtoons_decoder = {
+const AVCodec ff_cdtoons_decoder = {
.name = "cdtoons",
.long_name = NULL_IF_CONFIG_SMALL("CDToons video"),
.type = AVMEDIA_TYPE_VIDEO,
.decode = cdtoons_decode_frame,
.capabilities = AV_CODEC_CAP_DR1,
.flush = cdtoons_flush,
+ .caps_internal = FF_CODEC_CAP_INIT_THREADSAFE,
};