1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

avcodec/adts_parser: Don't presume buffer to be padded

The documentation of av_adts_header_parse() does not require
the buffer to be padded at all.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
(cherry picked from commit 6c812a80ddfadb3e69018971a2e92ace5326db36)
This commit is contained in:
Andreas Rheinhardt 2024-05-09 15:09:41 +02:00
parent a08da68e0a
commit 2bfcc11f51

View File

@ -27,9 +27,14 @@
int av_adts_header_parse(const uint8_t *buf, uint32_t *samples, uint8_t *frames)
{
#if CONFIG_ADTS_HEADER
uint8_t tmpbuf[AV_AAC_ADTS_HEADER_SIZE + AV_INPUT_BUFFER_PADDING_SIZE];
GetBitContext gb;
AACADTSHeaderInfo hdr;
int err = init_get_bits8(&gb, buf, AV_AAC_ADTS_HEADER_SIZE);
int err;
if (!buf)
return AVERROR(EINVAL);
memcpy(tmpbuf, buf, AV_AAC_ADTS_HEADER_SIZE);
err = init_get_bits8(&gb, tmpbuf, AV_AAC_ADTS_HEADER_SIZE);
if (err < 0)
return err;
err = ff_adts_header_parse(&gb, &hdr);