Mercurial > libavcodec.hg
changeset 7801:d965e46aef4f libavcodec
Test a var for overflow just after it is set
author | vitor |
---|---|
date | Sat, 06 Sep 2008 11:46:29 +0000 |
parents | a84494aa3818 |
children | ca4a5c6c275c |
files | ra144.c |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/ra144.c Sat Sep 06 11:45:10 2008 +0000 +++ b/ra144.c Sat Sep 06 11:46:29 2008 +0000 @@ -251,11 +251,11 @@ for (j=0; j <= i; j++) bp1[j] = ((bp2[j] - ((refl[i+1] * bp2[i-j]) >> 12)) * (0x1000000 / b)) >> 12; - refl[i] = bp1[i]; - if ((unsigned) bp1[i] + 0x1000 > 0x1fff) return 1; + refl[i] = bp1[i]; + FFSWAP(int *, bp1, bp2); } return 0;