X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcscd.c;h=af12246281e1ffab2e17fee6d2c5bc107a5edce6;hb=1ab74bc19354aedfb9afe71515952254753a75cc;hp=8781df110caa002d04498bedea950342df9ec85d;hpb=0ff76ca86e0ea4dcf2b392c45f5fac8e5576bb0d;p=ffmpeg diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 8781df110ca..af12246281e 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -77,7 +77,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, 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 @@ -93,7 +93,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, 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; } @@ -166,7 +166,7 @@ static av_cold int decode_end(AVCodecContext *avctx) return 0; } -AVCodec ff_cscd_decoder = { +const AVCodec ff_cscd_decoder = { .name = "camstudio", .long_name = NULL_IF_CONFIG_SMALL("CamStudio"), .type = AVMEDIA_TYPE_VIDEO,