mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-17 21:14:47 +00:00
avformat/siff: check avio_read() return value before returning packet
Fixes: /ld/michael/ffmpeg_uninit/ffmpeg_uninit/done/msan_uninit-mem_7fb3e0fa86e9_1980_INTRO_B.VB Fixes use of uninitialized memory Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
f4c62b9f64
commit
8a0d446ad6
@ -216,7 +216,10 @@ static int siff_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
AV_WL16(pkt->data, c->flags);
|
||||
if (c->gmcsize)
|
||||
memcpy(pkt->data + 2, c->gmc, c->gmcsize);
|
||||
avio_read(s->pb, pkt->data + 2 + c->gmcsize, size);
|
||||
if (avio_read(s->pb, pkt->data + 2 + c->gmcsize, size) != size) {
|
||||
av_free_packet(pkt);
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
pkt->stream_index = 0;
|
||||
c->curstrm = -1;
|
||||
}else{
|
||||
|
Loading…
Reference in New Issue
Block a user