[FFmpeg-cvslog] avformat/xmv: Check this_packet_size

Michael Niedermayer git at videolan.org
Wed Jul 24 17:51:03 EEST 2024


ffmpeg | branch: release/4.3 | Michael Niedermayer <michael at niedermayer.cc> | Thu Jul 11 22:37:54 2024 +0200| [3cc8b4b4954943d236733cea77c42b6ef3b5e253] | committer: Michael Niedermayer

avformat/xmv: Check this_packet_size

Fixes: CID1604489 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 696685df0ccf437083d15f40358a6ec86f5748ac)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=3cc8b4b4954943d236733cea77c42b6ef3b5e253
---

 libavformat/xmv.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/xmv.c b/libavformat/xmv.c
index 0c69d267de..6f94d20514 100644
--- a/libavformat/xmv.c
+++ b/libavformat/xmv.c
@@ -223,6 +223,8 @@ static int xmv_read_header(AVFormatContext *s)
     /* Initialize the packet context */
 
     xmv->next_packet_offset = avio_tell(pb);
+    if (this_packet_size < xmv->next_packet_offset)
+        return AVERROR_INVALIDDATA;
     xmv->next_packet_size   = this_packet_size - xmv->next_packet_offset;
     xmv->stream_count       = xmv->audio_track_count + 1;
 



More information about the ffmpeg-cvslog mailing list