提交 a5153b1d 编写于 作者: M Michael Niedermayer

shorten: Fix signedness of comparission

Fixes out of array accessed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: NMichael Niedermayer <michaelni@gmx.at>
上级 ce153eef
......@@ -349,7 +349,7 @@ static int read_header(ShortenContext *s)
int skip_bytes, blocksize;
blocksize = get_uint(s, av_log2(DEFAULT_BLOCK_SIZE));
if (!blocksize || blocksize > MAX_BLOCKSIZE) {
if (!blocksize || blocksize > (unsigned)MAX_BLOCKSIZE) {
av_log(s->avctx, AV_LOG_ERROR, "invalid or unsupported block size: %d\n",
blocksize);
return AVERROR(EINVAL);
......@@ -499,7 +499,7 @@ static int shorten_decode_frame(AVCodecContext *avctx, void *data,
av_log(avctx, AV_LOG_ERROR, "Increasing block size is not supported\n");
return AVERROR_PATCHWELCOME;
}
if (!blocksize || blocksize > MAX_BLOCKSIZE) {
if (!blocksize || blocksize > (unsigned)MAX_BLOCKSIZE) {
av_log(avctx, AV_LOG_ERROR, "invalid or unsupported "
"block size: %d\n", blocksize);
return AVERROR(EINVAL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册