mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-21 10:55:51 +02:00
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>
This commit is contained in:
parent
3dc06b6972
commit
bf868c4a9b
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user