Fixes: integer overflow: -2147483648 - 1 cannot be represented in type 'int' Fixes: 373971762/clusterfuzz-testcase-minimized-ffmpeg_dem_DXA_fuzzer-4880491112103936
Unified · Split
| @@ -120,6 +120,8 @@ static int dxa_read_header(AVFormatContext *s) · 119 unmodified lines | ||
| 120 | 120 | avio_skip(pb, fsize); |
| 121 | 121 | } |
| 122 | 122 | c->bpc = (fsize + (int64_t)c->frames - 1) / c->frames; |
| 123 | + if (c->bpc < 0) | |
| 124 | + return AVERROR_INVALIDDATA; | |
| 123 | 125 | if(ast->codecpar->block_align) { |
| 124 | 126 | if (c->bpc > INT_MAX - ast->codecpar->block_align + 1) |
| 125 | 127 | return AVERROR_INVALIDDATA; |