mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-29 02:42:21 +00:00
avformat/mlvdec: Don't leak open AVIOContexts on error
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
parent
6e0dd41fa3
commit
0d560873da
@ -52,6 +52,8 @@ typedef struct {
|
|||||||
uint64_t pts;
|
uint64_t pts;
|
||||||
} MlvContext;
|
} MlvContext;
|
||||||
|
|
||||||
|
static int read_close(AVFormatContext *s);
|
||||||
|
|
||||||
static int probe(const AVProbeData *p)
|
static int probe(const AVProbeData *p)
|
||||||
{
|
{
|
||||||
if (AV_RL32(p->buf) == MKTAG('M','L','V','I') &&
|
if (AV_RL32(p->buf) == MKTAG('M','L','V','I') &&
|
||||||
@ -376,6 +378,7 @@ static int read_header(AVFormatContext *avctx)
|
|||||||
|
|
||||||
if ((vst && !vst->nb_index_entries) || (ast && !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");
|
av_log(avctx, AV_LOG_ERROR, "no index entries found\n");
|
||||||
|
read_close(avctx);
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user