[FFmpeg-devel,2/3] tools/target_dec_fuzzer: Assert that max pixels is not violated

Submitted by Michael Niedermayer on July 31, 2019, 8:52 a.m.

Details

Message ID 20190731085234.26529-2-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer July 31, 2019, 8:52 a.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 0c398da95b..a3c735e339 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -259,6 +259,8 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
             av_frame_unref(frame);
             int ret = decode_handler(ctx, frame, &got_frame, &avpkt);
 
+            av_assert0(ctx->width * ctx->height <= maxpixels_per_frame);
+
             ec_pixels += ctx->width * ctx->height;
             if (it > 20 || ec_pixels > 4 * ctx->max_pixels)
                 ctx->error_concealment = 0;