tis 2019-08-20 klockan 21:05 -0300 skrev James Almer:
> Should reduce date copying considerably.
>
> Signed-off-by: James Almer <[email protected]>
> ---
> Fixed a stupid mistake when checking the return value for av_new_packet().
> Still untested.
Works great for me. Should make fuzzing faster overall, better use of
computing resources imo
> @@ -186,6 +144,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t
> size) {
> error("Failed memory allocation");
>
> ctx->max_pixels = maxpixels_per_frame; //To reduce false positive OOM
> and hangs
> + ctx->refcounted_frames = 1;
Could maybe have a comment that this is also to reduce false positives,
or that we want to focus on the new API rather than the old one
> @@ -240,7 +199,10 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t
> size) {
> if (data + sizeof(fuzz_tag) > end)
> data = end;
>
> - FDBPrepare(&buffer, &parsepkt, last, data - last);
> + res = av_new_packet(&parsepkt, data - last);
> + if (res < 0)
> + error("Failed memory allocation");
> + memcpy(parsepkt.data, last, data - last);
Is there some way to avoid this copy?
/Tomas
_______________________________________________
ffmpeg-devel mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".