summaryrefslogtreecommitdiff
path: root/libavcodec/fitsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-30 18:30:26 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-12-05 20:20:05 +0100
commit37f31f4e509fe4ccc56a64edaa6fa3d95ee20466 (patch)
treeef4a1845859fd59eb4b9605f9c118a5014983052 /libavcodec/fitsdec.c
parent4825d8a98d4cddab8710055213e99e47cfd5257a (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.c2
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; \
} \