[FFmpeg-devel] [PATCH 1/5] avcodec/aac/aacdec_usac: Test ac in usac
Lynne
dev at lynne.ee
Wed Jun 26 02:35:18 EEST 2024
On 24/06/2024 01:01, Michael Niedermayer wrote:
> ff_aac_usac_config_decode() needs AACDecContext to be set but some callers
> pass NULL.
>
> I have no real testcase to implement/test this, so failing in this case
> seems safest.
>
> Fixes: member access within null pointer of type 'AACDecContext' (aka 'struct AACDecContext')
> Fixes: 69435/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_LATM_fuzzer-5733527483121664
>
> 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/aac/aacdec_usac.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/libavcodec/aac/aacdec_usac.c b/libavcodec/aac/aacdec_usac.c
> index 132ffee9c20..4856c1786b7 100644
> --- a/libavcodec/aac/aacdec_usac.c
> +++ b/libavcodec/aac/aacdec_usac.c
> @@ -348,6 +348,9 @@ int ff_aac_usac_config_decode(AACDecContext *ac, AVCodecContext *avctx,
> int map_pos_set = 0;
> uint8_t layout_map[MAX_ELEM_ID*4][3] = { 0 };
>
> + if (!ac)
> + return AVERROR_PATCHWELCOME;
> +
> memset(usac, 0, sizeof(*usac));
>
> freq_idx = get_bits(gb, 5); /* usacSamplingFrequencyIndex */
This doesn't seem possible at all.
There are 2 callers, parse_audio_preroll and
decode_audio_specific_config_gb. Both of these will crash way before the
function is called.
Could you at least get a backtrace?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_0xA2FEA5F03F034464.asc
Type: application/pgp-keys
Size: 624 bytes
Desc: OpenPGP public key
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240626/384e82a1/attachment.key>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature.asc
Type: application/pgp-signature
Size: 236 bytes
Desc: OpenPGP digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240626/384e82a1/attachment.sig>
More information about the ffmpeg-devel
mailing list