diff options
author | Mans Rullgard <mans@mansr.com> | 2012-10-15 00:21:53 +0100 |
---|---|---|
committer | Mans Rullgard <mans@mansr.com> | 2012-10-15 21:41:25 +0100 |
commit | bf868c4a9bc6c1ac4c4753822a7c652b7f7c8ff7 (patch) | |
tree | 1169250ef2fe42130023a1db8d49dd7a5c331787 /tests/tiny_psnr.c | |
parent | 3dc06b6972cf389269e9c36ff0a4373f80f7149b (diff) | |
download | ffmpeg-bf868c4a9bc6c1ac4c4753822a7c652b7f7c8ff7.tar.gz |
tiny_psnr: fix range calculation for sample size of 32 bits
For a sample size of 32 bits, the shift would overflow producing
undefined results. Incidentally, in the only test currently using
32-bit samples, the output matches the reference exactly on most
systems meaning the bad 'max' value is never used.
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'tests/tiny_psnr.c')
-rw-r--r-- | tests/tiny_psnr.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c index a53a67038b..b1bcc16693 100644 --- a/tests/tiny_psnr.c +++ b/tests/tiny_psnr.c @@ -146,7 +146,7 @@ int main(int argc, char *argv[]) } } - max = (1 << (8 * len)) - 1; + max = (1LL << (8 * len)) - 1; f[0] = fopen(argv[1], "rb"); f[1] = fopen(argv[2], "rb"); |