diff mbox

[FFmpeg-devel] doc/examples/decoder_targeted: Limit max pixels for fuzzing

Message ID 20161217174053.16282-1-michael@niedermayer.cc
State Accepted
Commit 99af260d0b07aad075ce1a4a8d71aa65e460a4c2
Headers show

Commit Message

Michael Niedermayer Dec. 17, 2016, 5:40 p.m. UTC
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 doc/examples/decoder_targeted.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Michael Niedermayer Dec. 19, 2016, 6:58 p.m. UTC | #1
On Sat, Dec 17, 2016 at 06:40:53PM +0100, Michael Niedermayer wrote:
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>  doc/examples/decoder_targeted.c | 3 +++
>  1 file changed, 3 insertions(+)

applied

[...]
diff mbox

Patch

diff --git a/doc/examples/decoder_targeted.c b/doc/examples/decoder_targeted.c
index f254f603ee..e7e02b027e 100644
--- a/doc/examples/decoder_targeted.c
+++ b/doc/examples/decoder_targeted.c
@@ -147,6 +147,9 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
     AVCodecContext* ctx = avcodec_alloc_context3(NULL);
     if (!ctx)
         error("Failed memory allocation");
+
+    ctx->max_pixels = 4096 * 4096; //To reduce false positive OOM and hangs
+
     int res = avcodec_open2(ctx, c, NULL);
     if (res < 0)
         return res;