diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-22 17:06:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-22 17:06:22 +0200 |
commit | fa7defc89a7b6716aa853451134e5663cabb902d (patch) | |
tree | 8b8cd80b64e69bf0156358e092e45123b49bb801 | |
parent | fce350be0e7595846a6ce1a28bf240967283643e (diff) | |
parent | 93f16f338f9e8aba0c006752eb3afc3fe6e137fd (diff) | |
download | ffmpeg-fa7defc89a7b6716aa853451134e5663cabb902d.tar.gz |
Merge commit '93f16f338f9e8aba0c006752eb3afc3fe6e137fd'
* commit '93f16f338f9e8aba0c006752eb3afc3fe6e137fd':
asfdec: close the demuxer properly when read_header is failing
Merged-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavformat/asfdec_o.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index a8eb89f77a..2b26aea426 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -1659,14 +1659,14 @@ static int asf_read_header(AVFormatContext *s) if (ret == AVERROR_EOF && asf->data_reached) break; else - return ret; + goto failed; } g = find_guid(guid); if (g) { asf->unknown_offset = asf->offset; asf->is_header = 1; if ((ret = g->read_object(s, g)) < 0) - return ret; + goto failed; } else { size = avio_rl64(pb); align_position(pb, asf->offset, size); @@ -1677,7 +1677,8 @@ static int asf_read_header(AVFormatContext *s) if (!asf->data_reached) { av_log(s, AV_LOG_ERROR, "Data Object was not found.\n"); - return AVERROR_INVALIDDATA; + ret = AVERROR_INVALIDDATA; + goto failed; } if (pb->seekable) avio_seek(pb, asf->first_packet_offset, SEEK_SET); @@ -1702,6 +1703,10 @@ static int asf_read_header(AVFormatContext *s) } return 0; + +failed: + asf_read_close(s); + return ret; } AVInputFormat ff_asf_o_demuxer = { |