[FFmpeg-devel] [PATCH] tools/target_dec_fuzzer: set request_channel_layout

Michael Niedermayer michael at niedermayer.cc
Sat Dec 7 21:25:12 EET 2019


On Fri, Dec 06, 2019 at 08:31:09PM -0300, James Almer wrote:
> On 12/6/2019 8:08 PM, Michael Niedermayer wrote:
> > On Fri, Dec 06, 2019 at 11:56:13AM -0300, James Almer wrote:
> >> Should increase coverage of some decoders.
> >>
> >> Signed-off-by: James Almer <jamrial at gmail.com>
> >> ---
> >> Passing 6 to av_get_default_channel_layout() will return the 5.1 layout but
> >> never 5.1(side), which is for example what the dts decoder actually looks for.
> >> Any suggestion on how to make the fuzzer pick one of the non default layouts
> >> using a given amount of channels?
> > 
> > did you try:
> > 
> > diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
> > index 691a79329f..d53dccdcf5 100644
> > --- a/tools/target_dec_fuzzer.c
> > +++ b/tools/target_dec_fuzzer.c
> > @@ -212,6 +212,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
> >          ctx->codec_tag                          = bytestream2_get_le32(&gbc);
> >          keyframes                               = bytestream2_get_le64(&gbc);
> >          flushpattern                            = bytestream2_get_le64(&gbc);
> > +        ctx->request_channel_layout             = bytestream2_get_le64(&gbc);
> 
> I guess it'll going to get a hit at some point whereas my approach will
> not, so LGTM.

will apply (unless i see some problem before)

thanks

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

Its not that you shouldnt use gotos but rather that you should write
readable code and code with gotos often but not always is less readable
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20191207/516ea172/attachment.sig>


More information about the ffmpeg-devel mailing list