mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-19 09:02:26 +02: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;
|
AVStream *st;
|
||||||
uint8_t profile_level;
|
uint8_t profile_level;
|
||||||
|
int ret;
|
||||||
|
|
||||||
if (c->fc->nb_streams < 1)
|
if (c->fc->nb_streams < 1)
|
||||||
return 0;
|
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))
|
if (ff_alloc_extradata(st->codec, atom.size - 7))
|
||||||
return AVERROR(ENOMEM);
|
return AVERROR(ENOMEM);
|
||||||
avio_seek(pb, 6, SEEK_CUR);
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user