[PR] avformat/mlv: end the LJ92 packet where its data ends (PR #24102)

michaelni via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178649916659.59.12495633794308035172@29965ddac10e>
PR #24102 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24102
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24102.patch

Fixes: read of uninitialized memory
Fixes: PJaSVrRTt6Kf
Found-by: Eunsoo Kim, Microsoft FORGE Labs



>From c64d3efec5c05f2e1251fad09ab82a34b43def1a Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <[email protected]>
Date: Wed, 12 Aug 2026 03:22:35 +0200
Subject: [PATCH] avformat/mlv: end the LJ92 packet where its data ends

Fixes: read of uninitialized memory
Fixes: PJaSVrRTt6Kf
Found-by: Eunsoo Kim, Microsoft FORGE Labs
---
 libavformat/mlvdec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/mlvdec.c b/libavformat/mlvdec.c
index 2c1fe001c7..93e29f231c 100644
--- a/libavformat/mlvdec.c
+++ b/libavformat/mlvdec.c
@@ -528,6 +528,7 @@ static int get_packet_lj92(AVFormatContext *avctx, AVStream *st, AVIOContext *pb
     ret = avio_read(pbio, pkt->data + header_size, size);
     if (ret < 0)
         return ret;
+    av_shrink_packet(pkt, header_size + ret);
 
     return 0;
 }
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.