summaryrefslogtreecommitdiff
path: root/libavcodec/shorten.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-19 23:06:40 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-19 23:08:19 +0100
commita5153b1d1692e51cf69ff28bc6a25ce5241774e0 (patch)
treec937540425cef64108712e8fa6248ee352f5a2c0 /libavcodec/shorten.c
parentce153eef8ffdd10ead74ad4646eb784be1c5b107 (diff)
shorten: Fix signedness of comparission
Fixes out of array accessed Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/shorten.c')
-rw-r--r--libavcodec/shorten.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index e993c14b61..648df68204 100644
--- a/libavcodec/shorten.c
+++ b/libavcodec/shorten.c
@@ -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);