Some ADTS files have a first frame that's shorter than the 10 bytes that are being read while checking for ID3 tags.
Fixes #7271 Signed-off-by: Menno de Gier <mrdeg...@gmail.com> --- libavformat/aacdec.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libavformat/aacdec.c b/libavformat/aacdec.c index bd324a1420..25bccfbcb8 100644 --- a/libavformat/aacdec.c +++ b/libavformat/aacdec.c @@ -184,6 +184,15 @@ static int adts_aac_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR_INVALIDDATA; } + if (fsize < pkt->size) { + ret = avio_seek(s->pb, fsize - pkt->size, SEEK_CUR); + if (ret < 0) { + av_packet_unref(pkt); + return ret; + } + av_shrink_packet(pkt, fsize); + } + ret = av_append_packet(s->pb, pkt, fsize - pkt->size); if (ret < 0) av_packet_unref(pkt); -- 2.19.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".