diff mbox series

[FFmpeg-devel] tools/target_dec_fuzzer: Fix build failure from channels API

Message ID 20220315223444.3449-1-michael@niedermayer.cc
State Accepted
Commit 9805a0004cbfc487934a7792ffe21b329336dc5c
Headers show
Series [FFmpeg-devel] tools/target_dec_fuzzer: Fix build failure from channels API | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished
andriy/make_aarch64_jetson success Make finished
andriy/make_fate_aarch64_jetson success Make fate finished
andriy/make_armv7_RPi4 success Make finished
andriy/make_fate_armv7_RPi4 success Make fate finished

Commit Message

Michael Niedermayer March 15, 2022, 10:34 p.m. UTC
Regression since 2f8ccca2fa94ce256ff77baa18f462c1abd8d2cc and surrounding commits

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 tools/target_dec_fuzzer.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

James Almer March 15, 2022, 10:45 p.m. UTC | #1
On 3/15/2022 7:34 PM, Michael Niedermayer wrote:
> Regression since 2f8ccca2fa94ce256ff77baa18f462c1abd8d2cc and surrounding commits
> 
> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> ---
>   tools/target_dec_fuzzer.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
> index eaa26b0e62..3bd1eff3ce 100644
> --- a/tools/target_dec_fuzzer.c
> +++ b/tools/target_dec_fuzzer.c
> @@ -47,6 +47,7 @@
>   
>   #include "config.h"
>   #include "libavutil/avassert.h"
> +#include "libavutil/avstring.h"

Why?

>   #include "libavutil/cpu.h"
>   #include "libavutil/imgutils.h"
>   #include "libavutil/intreadwrite.h"
> @@ -273,7 +274,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
>           extradata_size = bytestream2_get_le32(&gbc);
>   
>           ctx->sample_rate                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
> -        ctx->ch_layout.channels                 = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
> +        ctx->ch_layout.nb_channels              = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;

LGTM, sorry about the breakage.

>           ctx->block_align                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
>           ctx->codec_tag                          = bytestream2_get_le32(&gbc);
>           if (c->codec_tags) {
Michael Niedermayer March 16, 2022, 12:33 a.m. UTC | #2
On Tue, Mar 15, 2022 at 07:45:36PM -0300, James Almer wrote:
> On 3/15/2022 7:34 PM, Michael Niedermayer wrote:
> > Regression since 2f8ccca2fa94ce256ff77baa18f462c1abd8d2cc and surrounding commits
> > 
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > ---
> >   tools/target_dec_fuzzer.c | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
> > index eaa26b0e62..3bd1eff3ce 100644
> > --- a/tools/target_dec_fuzzer.c
> > +++ b/tools/target_dec_fuzzer.c
> > @@ -47,6 +47,7 @@
> >   #include "config.h"
> >   #include "libavutil/avassert.h"
> > +#include "libavutil/avstring.h"
> 
> Why?

av_strlcatf() IIRC

> 
> >   #include "libavutil/cpu.h"
> >   #include "libavutil/imgutils.h"
> >   #include "libavutil/intreadwrite.h"
> > @@ -273,7 +274,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
> >           extradata_size = bytestream2_get_le32(&gbc);
> >           ctx->sample_rate                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
> > -        ctx->ch_layout.channels                 = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
> > +        ctx->ch_layout.nb_channels              = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
> 
> LGTM, sorry about the breakage.

will apply tomorrow, feel free to apply before

thx

[...]
James Almer March 16, 2022, 12:37 a.m. UTC | #3
On 3/15/2022 9:33 PM, Michael Niedermayer wrote:
> On Tue, Mar 15, 2022 at 07:45:36PM -0300, James Almer wrote:
>> On 3/15/2022 7:34 PM, Michael Niedermayer wrote:
>>> Regression since 2f8ccca2fa94ce256ff77baa18f462c1abd8d2cc and surrounding commits
>>>
>>> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
>>> ---
>>>    tools/target_dec_fuzzer.c | 3 ++-
>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
>>> index eaa26b0e62..3bd1eff3ce 100644
>>> --- a/tools/target_dec_fuzzer.c
>>> +++ b/tools/target_dec_fuzzer.c
>>> @@ -47,6 +47,7 @@
>>>    #include "config.h"
>>>    #include "libavutil/avassert.h"
>>> +#include "libavutil/avstring.h"
>>
>> Why?
> 
> av_strlcatf() IIRC

Seems unrelated, but ok.

> 
>>
>>>    #include "libavutil/cpu.h"
>>>    #include "libavutil/imgutils.h"
>>>    #include "libavutil/intreadwrite.h"
>>> @@ -273,7 +274,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
>>>            extradata_size = bytestream2_get_le32(&gbc);
>>>            ctx->sample_rate                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
>>> -        ctx->ch_layout.channels                 = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
>>> +        ctx->ch_layout.nb_channels              = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
>>
>> LGTM, sorry about the breakage.
> 
> will apply tomorrow, feel free to apply before
> 
> thx

Applied.
diff mbox series

Patch

diff --git a/tools/target_dec_fuzzer.c b/tools/target_dec_fuzzer.c
index eaa26b0e62..3bd1eff3ce 100644
--- a/tools/target_dec_fuzzer.c
+++ b/tools/target_dec_fuzzer.c
@@ -47,6 +47,7 @@ 
 
 #include "config.h"
 #include "libavutil/avassert.h"
+#include "libavutil/avstring.h"
 #include "libavutil/cpu.h"
 #include "libavutil/imgutils.h"
 #include "libavutil/intreadwrite.h"
@@ -273,7 +274,7 @@  int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         extradata_size = bytestream2_get_le32(&gbc);
 
         ctx->sample_rate                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
-        ctx->ch_layout.channels                 = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
+        ctx->ch_layout.nb_channels              = (unsigned)bytestream2_get_le32(&gbc) % FF_SANE_NB_CHANNELS;
         ctx->block_align                        = bytestream2_get_le32(&gbc) & 0x7FFFFFFF;
         ctx->codec_tag                          = bytestream2_get_le32(&gbc);
         if (c->codec_tags) {