Mercurial > libavcodec.hg
changeset 8487:88e8b4f81275 libavcodec
Fix yet another sechole.
author | michael |
---|---|
date | Fri, 26 Dec 2008 18:06:29 +0000 |
parents | 87284151c592 |
children | f2590c8d5e9b |
files | faxcompr.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/faxcompr.c Fri Dec 26 17:51:10 2008 +0000 +++ b/faxcompr.c Fri Dec 26 18:06:29 2008 +0000 @@ -156,10 +156,11 @@ } static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb, - int width, int *runs, const int *runend, const int *ref) + unsigned int width, int *runs, const int *runend, const int *ref) { - int mode = 0, offs = 0, run = 0, saved_run = 0, t; + int mode = 0, saved_run = 0, t; int run_off = *ref++; + unsigned int offs=0, run= 0; runend--; // for the last written 0 @@ -200,7 +201,7 @@ } saved_run = 0; offs += run; - if(offs > width){ + if(offs > width || run > width){ av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n"); return -1; }