Commit 557481dea6 for ffmpeg

commit 557481dea63e14ebfa8861acd12ff19c10a6ca99
Author: Michael Niedermayer <michael@niedermayer.cc>
Date:   Tue Oct 6 23:22:46 2026 +0200

    avformat/rdt: Check the size of the AAC data left in the packet

    The check was suggested in the report.

    Hardening for JRU5LF4QdVjc (AISLE-2026-0111-00165)
    Found-by: Joshua Rogers <joshua.rogers@aisle.com>

diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 7bab6ce522..8228016aa1 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -317,6 +317,8 @@ rdt_parse_packet (AVFormatContext *ctx, PayloadContext *rdt, AVStream *st,
             return res;
         if (res > 0) {
             if (st->codecpar->codec_id == AV_CODEC_ID_AAC) {
+                if (len - pos > sizeof(rdt->buffer))
+                    return AVERROR_INVALIDDATA;
                 memcpy (rdt->buffer, buf + pos, len - pos);
                 rdt->rmctx->pb = avio_alloc_context (rdt->buffer, len - pos, 0,
                                                     NULL, NULL, NULL, NULL);