Browse Source

faxcompr: Dont read ref when the end has been reached in pass mode

Fixes reading over the end

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
tags/n1.2
Michael Niedermayer 12 years ago
parent
commit
6f9ae391de
1 changed files with 4 additions and 2 deletions
  1. +4
    -2
      libavcodec/faxcompr.c

+ 4
- 2
libavcodec/faxcompr.c View File

@@ -170,10 +170,12 @@ static int decode_group3_2d_line(AVCodecContext *avctx, GetBitContext *gb,
return -1;
}
if(!cmode){//pass mode
run_off += *ref++;
if(run_off < width)
run_off += *ref++;
run = run_off - offs;
offs= run_off;
run_off += *ref++;
if(run_off < width)
run_off += *ref++;
if(offs > width){
av_log(avctx, AV_LOG_ERROR, "Run went out of bounds\n");
return -1;


Loading…
Cancel
Save