mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-10-19 09:53:18 +00:00
avcodec/fitsdec: Fail on 0 naxisn
Fixes: Timeout (100+ sec -> 23ms)
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
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 4a3303d520
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
4b7829bf9c
commit
60c8cf09df
1 changed files with 1 additions and 1 deletions
|
@ -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 (size && header->naxisn[i] > SIZE_MAX / size) {
|
||||
if (size == 0 || header->naxisn[i] > SIZE_MAX / size) {
|
||||
av_log(avctx, AV_LOG_ERROR, "unsupported size of FITS image");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue