diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 2d3540a229..920887b2a0 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -445,6 +445,10 @@ static int read_header(ShortenContext *s) s->blocksize = blocksize; maxnlpc = get_uint(s, LPCQSIZE); + if (maxnlpc > 1024U) { + av_log(s->avctx, AV_LOG_ERROR, "maxnlpc is: %d\n", maxnlpc); + return AVERROR_INVALIDDATA; + } s->nmean = get_uint(s, 0); skip_bytes = get_uint(s, NSKIPSIZE);