mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-24 11:49:48 +00:00
avformat/mov: check avio_read return in mov_read_dvc1()
Fixes use of uninitialized memory Fixes: msan_uninit-mem_7f46d5199ee1_9456_vc1-wmapro.ism Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
0d944ee343
commit
2a5fb0b13e
@ -1133,6 +1133,7 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
{
|
||||
AVStream *st;
|
||||
uint8_t profile_level;
|
||||
int ret;
|
||||
|
||||
if (c->fc->nb_streams < 1)
|
||||
return 0;
|
||||
@ -1149,7 +1150,10 @@ static int mov_read_dvc1(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
if (ff_alloc_extradata(st->codec, atom.size - 7))
|
||||
return AVERROR(ENOMEM);
|
||||
avio_seek(pb, 6, SEEK_CUR);
|
||||
avio_read(pb, st->codec->extradata, st->codec->extradata_size);
|
||||
ret = avio_read(pb, st->codec->extradata, st->codec->extradata_size);
|
||||
if (ret != st->codec->extradata_size)
|
||||
return ret < 0 ? ret : AVERROR_INVALIDDATA;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user