Re: [FFmpeg-devel] [PATCH] tools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames

2019-06-05 Thread Michael Niedermayer
On Fri, May 17, 2019 at 10:57:53AM +0200, Michael Niedermayer wrote:
> This should reduce the amount of timeout issues overall
> 
> Fixes: Timeout (34->10sec)
> Fixes: 
> 14682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5728608414334976
> 
> Found-by: continuous fuzzing process 
> https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
> Signed-off-by: Michael Niedermayer 
> ---
>  tools/target_dec_fuzzer.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

will apply


[...]
-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.


signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-devel] [PATCH] tools/target_dec_fuzzer: Limit error concealment on pixels instead of just frames

2019-05-17 Thread Michael Niedermayer
This should reduce the amount of timeout issues overall

Fixes: Timeout (34->10sec)
Fixes: 
14682/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5728608414334976

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer 
---
 tools/target_dec_fuzzer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index 2a6d525b73..4f51b70b65 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -137,6 +137,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 const uint8_t *last = data;
 const uint8_t *end = data + size;
 uint32_t it = 0;
+uint64_t ec_pixels = 0;
 int (*decode_handler)(AVCodecContext *avctx, AVFrame *picture,
   int *got_picture_ptr,
   const AVPacket *avpkt) = NULL;
@@ -244,7 +245,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t 
size) {
 av_frame_unref(frame);
 int ret = decode_handler(ctx, frame, _frame, );
 
-if (it > 20)
+ec_pixels += ctx->width * ctx->height;
+if (it > 20 || ec_pixels > 4 * ctx->max_pixels)
 ctx->error_concealment = 0;
 
 if (ret <= 0 || ret > avpkt.size)
-- 
2.21.0

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".