mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
mlvdec: check that index_entries exist
This fixes NULL pointer dereferencing. Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> (cherry picked from commit 9fcfe4a3cdf9a5af0c37758b178965b7b99582d4) Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
This commit is contained in:
parent
1dc135e03d
commit
93eda8dcba
@ -365,6 +365,11 @@ static int read_header(AVFormatContext *avctx)
|
||||
if (ast)
|
||||
ast->duration = ast->nb_index_entries;
|
||||
|
||||
if ((vst && !vst->nb_index_entries) || (ast && !ast->nb_index_entries)) {
|
||||
av_log(avctx, AV_LOG_ERROR, "no index entries found\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (vst && ast)
|
||||
avio_seek(pb, FFMIN(vst->index_entries[0].pos, ast->index_entries[0].pos), SEEK_SET);
|
||||
else if (vst)
|
||||
|
Loading…
x
Reference in New Issue
Block a user