[FFmpeg-cvslog] tiny_psnr: fix range calculation for sample size of 32 bits
Mans Rullgard
git at videolan.org
Tue Oct 16 14:19:40 CEST 2012
ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Mon Oct 15 00:21:53 2012 +0100| [bf868c4a9bc6c1ac4c4753822a7c652b7f7c8ff7] | committer: Mans Rullgard
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 at mansr.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bf868c4a9bc6c1ac4c4753822a7c652b7f7c8ff7
---
tests/tiny_psnr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/tiny_psnr.c b/tests/tiny_psnr.c
index a53a670..b1bcc16 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");
More information about the ffmpeg-cvslog
mailing list