summaryrefslogtreecommitdiff
path: root/tests/fix_this.c
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2012-03-13 20:41:19 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2012-03-13 20:41:19 +1100
commit9f9f63a16105759e077108b2b0604d8678c9e4e0 (patch)
treeb6a99399eea21d47688dda5b7b56df64074c7195 /tests/fix_this.c
parentcb768da919bca2d1d55886e3a3264f4ab73dbcc1 (diff)
tests/fix_this.c : Fix potential int overflow.
Diffstat (limited to 'tests/fix_this.c')
-rw-r--r--tests/fix_this.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/fix_this.c b/tests/fix_this.c
index de1b00b..4cbb8d4 100644
--- a/tests/fix_this.c
+++ b/tests/fix_this.c
@@ -70,8 +70,9 @@ static void
lcomp_test_int (const char *str, const char *filename, int filetype, double margin)
{ SNDFILE *file ;
SF_INFO sfinfo ;
- int k, m, *orig, *data, sum_abs ;
+ int k, m, *orig, *data ;
sf_count_t datalen, seekpos ;
+ int64_t sum_abs ;
double scale ;
printf ("\nThis is program is not part of the libsndfile test suite.\n\n") ;
@@ -153,7 +154,7 @@ lcomp_test_int (const char *str, const char *filename, int filetype, double marg
oct_save_int (orig, data, datalen) ;
exit (1) ;
} ;
- sum_abs = abs (sum_abs + abs (data [k])) ;
+ sum_abs += abs (data [k]) ;
} ;
if (sum_abs < 1.0)