summaryrefslogtreecommitdiffstats
path: root/libavcodec/fitsdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-06-13 16:08:03 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-06-25 13:30:09 +0200
commit07ffe94c172041cfb03109b9bb6b8bf577332bda (patch)
treee4278a9eb3b6f8901aa64a8c0fbd4524710b47e0 /libavcodec/fitsdec.c
parentf8f5668df590d853429586e1f95cbd9cee38920e (diff)
downloadffmpeg-streaming-07ffe94c172041cfb03109b9bb6b8bf577332bda.zip
ffmpeg-streaming-07ffe94c172041cfb03109b9bb6b8bf577332bda.tar.gz
avcodec/fitsdec: Fix division by 0 in size check
Fixes: division by zero Fixes: 15210/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FITS_fuzzer-5746033243455488 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 b075381..67a8bd7 100644
--- a/libavcodec/fitsdec.c
+++ b/libavcodec/fitsdec.c
@@ -143,7 +143,7 @@ static int fits_read_header(AVCodecContext *avctx, const uint8_t **ptr, FITSHead
size = abs(header->bitpix) >> 3;
for (i = 0; i < header->naxis; i++) {
- if (header->naxisn[i] > SIZE_MAX / size) {
+ if (size && header->naxisn[i] > SIZE_MAX / size) {
av_log(avctx, AV_LOG_ERROR, "unsupported size of FITS image");
return AVERROR_INVALIDDATA;
}
OpenPOWER on IntegriCloud