avformat/xmv: Check this_packet_size

Fixes: CID1604489 Overflowed constant

Sponsored-by: Sovereign Tech Fund
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2024-07-11 22:37:54 +02:00
parent 7734c583f7
commit 696685df0c
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 2 additions and 0 deletions

View File

@ -221,6 +221,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;