Fixes: Timeout Fixes: 48418/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MTS2_fuzzer-4834851466903552
Unified · Split
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | */ |
| 27 | 27 | |
| 28 | 28 | #include "libavutil/thread.h" |
| 29 | +#include "libavutil/imgutils.h" | |
| 29 | 30 | |
| 30 | 31 | #include "avcodec.h" |
| 31 | 32 | #include "bytestream.h" |
| @@ -477,6 +478,9 @@ static int mss4_decode_frame(AVCodecContext *avctx, AVFrame *rframe, · 445 unmodified lines | ||
| 477 | 478 | width, height); |
| 478 | 479 | return AVERROR_INVALIDDATA; |
| 479 | 480 | } |
| 481 | + if (av_image_check_size2(width, height, avctx->max_pixels, AV_PIX_FMT_NONE, 0, avctx) < 0) | |
| 482 | + return AVERROR_INVALIDDATA; | |
| 483 | + | |
| 480 | 484 | if (quality < 1 || quality > 100) { |
| 481 | 485 | av_log(avctx, AV_LOG_ERROR, "Invalid quality setting %d\n", quality); |
| 482 | 486 | return AVERROR_INVALIDDATA; |