[FFmpeg-devel] [PATCH 2/8] avcodec/hcadec: Check sample_rate
Michael Niedermayer
michael at niedermayer.cc
Fri Jun 20 17:28:23 EEST 2025
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 <michael at niedermayer.cc>
> > ---
> > 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
-------------- 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/20250620/208e9e21/attachment.sig>
More information about the ffmpeg-devel
mailing list