return AVERROR_INVALIDDATA;
}
- if ((ret = ff_reget_buffer(avctx, c->pic)) < 0)
+ if ((ret = ff_reget_buffer(avctx, c->pic, 0)) < 0)
return ret;
// decompress data
case 1: { // zlib compression
#if CONFIG_ZLIB
unsigned long dlen = c->decomp_size;
- if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK) {
+ if (uncompress(c->decomp_buf, &dlen, &buf[2], buf_size - 2) != Z_OK || dlen != c->decomp_size) {
av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n");
return AVERROR_INVALIDDATA;
}
return 0;
}
-AVCodec ff_cscd_decoder = {
+const AVCodec ff_cscd_decoder = {
.name = "camstudio",
.long_name = NULL_IF_CONFIG_SMALL("CamStudio"),
.type = AVMEDIA_TYPE_VIDEO,