diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2015-02-24 03:12:22 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-25 03:37:42 +0100 |
commit | 7afb16c9a1c8d6e04d7ba084d1cd6b8557805d72 (patch) | |
tree | 26bf83e6cd461eee3db2d0c417dcb8f053e5d534 /libavcodec/snowdec.c | |
parent | a79e5c994cf9af9cdd527fd9a2f7b8f9e02e84b0 (diff) | |
download | ffmpeg-7afb16c9a1c8d6e04d7ba084d1cd6b8557805d72.tar.gz |
avcodec/snowdec: Fix ref value check
Fixes integer overflow and out of array read.
Fixes: signal_sigsegv_24169e6_3445_cov_3778346427_snow_chroma_bug.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 8f4cbf940212079a34753c7f4d6c6b5a43586d30)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/snowdec.c')
-rw-r--r-- | libavcodec/snowdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/snowdec.c b/libavcodec/snowdec.c index c9d40b84e3..5aae25ae0f 100644 --- a/libavcodec/snowdec.c +++ b/libavcodec/snowdec.c @@ -153,7 +153,7 @@ static int decode_q_branch(SnowContext *s, int level, int x, int y){ int l = left->color[0]; int cb= left->color[1]; int cr= left->color[2]; - int ref = 0; + unsigned ref = 0; int ref_context= av_log2(2*left->ref) + av_log2(2*top->ref); int mx_context= av_log2(2*FFABS(left->mx - top->mx)) + 0*av_log2(2*FFABS(tr->mx - top->mx)); int my_context= av_log2(2*FFABS(left->my - top->my)) + 0*av_log2(2*FFABS(tr->my - top->my)); |