[FFmpeg-cvslog] shorten: Fix signedness of comparission

Michael Niedermayer git at videolan.org
Tue Feb 19 23:16:46 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Feb 19 23:06:40 2013 +0100| [a5153b1d1692e51cf69ff28bc6a25ce5241774e0] | committer: Michael Niedermayer

shorten: Fix signedness of comparission

Fixes out of array accessed

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a5153b1d1692e51cf69ff28bc6a25ce5241774e0
---

 libavcodec/shorten.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c
index e993c14..648df68 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);



More information about the ffmpeg-cvslog mailing list