Skip to content

Commit

Permalink
wavpack: check the blocks sample count, fix out of array accesses
Browse files Browse the repository at this point in the history
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <[email protected]>
  • Loading branch information
michaelni committed Nov 13, 2012
1 parent 580021c commit d8a1eb1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavcodec/wavpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,10 @@ static int wavpack_decode_block(AVCodecContext *avctx, int block_no,
*got_frame_ptr = 0;
return 0;
}
if (s->samples > wc->samples) {
av_log(avctx, AV_LOG_ERROR, "too many samples in block");
return -1;
}
} else {
s->samples = wc->samples;
}
Expand Down

0 comments on commit d8a1eb1

Please sign in to comment.