aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-12-26 18:06:29 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-12-26 18:06:29 +0000
commit268309750b56803642f12706aeb0576cd8183570 (patch)
tree3a2de9a8eb8fff05c4b098c2d749234ee94f544b /libavcodec
parent11c5999e20c49e0f26af8bb8c60214da1f308ab3 (diff)
downloadffmpeg-268309750b56803642f12706aeb0576cd8183570.tar.gz
Fix yet another sechole.
Originally committed as revision 16345 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/faxcompr.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index 54428e7d8c..72ad8b95da 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -156,10 +156,11 @@ static int decode_group3_1d_line(AVCodecContext *avctx, GetBitContext *gb,
}
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 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
}
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;
}