diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-13 01:47:31 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-10-25 21:12:40 +0200 |
commit | db4903f4e4b553b72059ed407b012aca6769b8ea (patch) | |
tree | 29f7d02f2b5f78d79c8d02b5e74fc4f796ba99b5 | |
parent | 7a0e5a63d01b8d70e638dff3f136b49e57c944ee (diff) | |
download | ffmpeg-db4903f4e4b553b72059ed407b012aca6769b8ea.tar.gz |
ffv1: avoid checking a double for equality
if 0.0 != 0.0 a out of array read would occur, equal checks
with floating point may behave in such odd ways, though
this is very unlikely in a real implementation of a compiler
Fixes: CID718936
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 54b2d317ed99622efa07b10aca217e1a083105d9)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/ffv1.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index c3034d326c..4d3a52887c 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -255,7 +255,7 @@ static void find_best_state(uint8_t best_state[256][256], const uint8_t one_stat occ[j]=1.0; for(k=0; k<256; k++){ double newocc[256]={0}; - for(m=0; m<256; m++){ + for(m=1; m<256; m++){ if(occ[m]){ len -=occ[m]*( p *l2tab[ m] + (1-p)*l2tab[256-m]); |