diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2019-09-30 19:30:26 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-12-05 22:20:05 +0300 |
commit | 37f31f4e509fe4ccc56a64edaa6fa3d95ee20466 (patch) | |
tree | ef4a1845859fd59eb4b9605f9c118a5014983052 /libavcodec/fitsdec.c | |
parent | 4825d8a98d4cddab8710055213e99e47cfd5257a (diff) |
avcodec/fitsdec: Use lrint()
Fixes: fate-fitsdec-bitpix-64
Possibly Fixes: -nan is outside the range of representable values of type 'unsigned short'
Possibly Fixes: 17769/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5678314672357376
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/fitsdec.c')
-rw-r--r-- | libavcodec/fitsdec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/fitsdec.c b/libavcodec/fitsdec.c index 1f06754f8b..32a79cdd0d 100644 --- a/libavcodec/fitsdec.c +++ b/libavcodec/fitsdec.c @@ -279,7 +279,7 @@ static int fits_decode_frame(AVCodecContext *avctx, void *data, int *got_frame, for (j = 0; j < avctx->width; j++) { \ t = rd; \ if (!header.blank_found || t != header.blank) { \ - *dst++ = ((t - header.data_min) * ((1 << (sizeof(type) * 8)) - 1)) * scale; \ + *dst++ = lrint(((t - header.data_min) * ((1 << (sizeof(type) * 8)) - 1)) * scale); \ } else { \ *dst++ = fitsctx->blank_val; \ } \ |