X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcscd.c;h=5eb511a5659183f4c2592b8d83db6313804b80a6;hb=6dbb64fdccafe846aaec75d3784f7ad49d8af5df;hp=9e1dec9d967f7c7070cb465991cba485073bb6aa;hpb=c00b218a8f75ed3eb87c213d95bd5775c0af5e12;p=ffmpeg diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 9e1dec9d967..5eb511a5659 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -81,15 +81,19 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame, switch ((buf[0] >> 1) & 7) { case 0: { // lzo compression int outlen = c->decomp_size, inlen = buf_size - 2; - if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen)) + if (av_lzo1x_decode(c->decomp_buf, &outlen, &buf[2], &inlen) || outlen) { av_log(avctx, AV_LOG_ERROR, "error during lzo decompression\n"); + return AVERROR_INVALIDDATA; + } break; } 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) { av_log(avctx, AV_LOG_ERROR, "error during zlib decompression\n"); + return AVERROR_INVALIDDATA; + } break; #else av_log(avctx, AV_LOG_ERROR, "compiled without zlib support\n");