Hi Andreas On Fri, Jun 20, 2025 at 10:45:46AM +0200, Andreas Rheinhardt wrote: > Michael Niedermayer: > > Fixes: AVERROR_BUG return > > Fixes: 413997604/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HCA_fuzzer-5188382613635072 > > > > Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg > > Signed-off-by: Michael Niedermayer > > --- > > libavcodec/hcadec.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/libavcodec/hcadec.c b/libavcodec/hcadec.c > > index 7780372cf3f..161044bfbcc 100644 > > --- a/libavcodec/hcadec.c > > +++ b/libavcodec/hcadec.c > > @@ -179,6 +179,9 @@ static void ath_init1(uint8_t *ath, int sample_rate) > > > > static int ath_init(uint8_t *ath, int type, int sample_rate) > > { > > + if (sample_rate <= 0) > > + return AVERROR_INVALIDDATA; > > + > > switch (type) { > > case 0: > > /* nothing to do */ > > The sample rate used here comes from avctx->sample_rate, > so why do you > want to check this here instead of checking it generically for all audio > decoders without AV_CODEC_CAP_CHANNEL_CONF I have not considered this alternative. Your patch is better thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The bravest are surely those who have the clearest vision of what is before them, glory and danger alike, and yet notwithstanding go out to meet it. -- Thucydides