[FFmpeg-devel] [PATCH 8/8] avcodec/codec_internal: Include codec_tags only when they are needed

Michael Niedermayer michael at niedermayer.cc
Fri Mar 18 15:13:16 EET 2022


On Fri, Mar 18, 2022 at 11:52:54AM +0100, Andreas Rheinhardt wrote:
> They are only needed for the fuzzer, so check for CONFIG_OSSFUZZ.
> This decreases sizeof(FFCodec), which is important given that
> FFCodecs reside in .data.rel.ro in case of ELF with
> position-independent code which is always loaded and can't be shared
> between processes.
> 

They are currently only used by the fuzzer, if there is no other
use, iam not sure. But i agree shareable memory would be better for them


[...]
> diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
> index 288aa63313..77f4bb8dd8 100644
> --- a/tools/target_dec_fuzzer.c
> +++ b/tools/target_dec_fuzzer.c
> @@ -279,12 +279,14 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
>          ctx->sample_rate                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
>          ctx->ch_layout.nb_channels              = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
>          ctx->block_align                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
> +#if CONFIG_OSSFUZZ
>          ctx->codec_tag                          = bytestream2_get_le32(&gbc);
>          if (c->codec_tags) {
>              int n;
>              for (n = 0; c->codec_tags[n] != FF_CODEC_TAGS_END; n++);
>              ctx->codec_tag = c->codec_tags[ctx->codec_tag % n];
>          }
> +#endif
>          keyframes                               = bytestream2_get_le64(&gbc);
>          request_channel_layout                  = bytestream2_get_le64(&gbc);
>  

how does the fuzzer work without the fuzzer ?

thx

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

"You are 36 times more likely to die in a bathtub than at the hands of a
terrorist. Also, you are 2.5 times more likely to become a president and
2 times more likely to become an astronaut, than to die in a terrorist
attack." -- Thoughty2

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20220318/f1731863/attachment.sig>


More information about the ffmpeg-devel mailing list