You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-06-19 19:03:00 +02:00
avformat/demux: use correct close function for custom io
You may look and think `AVFMT_FLAG_CUSTOM_IO` check is enough, but this is not what it seems. This flag means that user provided custom AVIOContext, before creating AVFormatContext and it should not be closed. However nested sub-demuxers may still open an temporary io, and those have to be closed and use correct io_close2 function. You can see0dcac9c3f0andef01061225where this flag is cleared for nested opens to avoid leaking those. lavf micro version bumped so API users can know if it is safe to use custom io. (cherry picked from commitdc74fe70b2) Signed-off-by: Kacper Michajłow <kasper93@gmail.com>
This commit is contained in:
+1
-1
@@ -365,7 +365,7 @@ fail:
|
||||
ff_id3v2_free_extra_meta(&id3v2_extra_meta);
|
||||
av_dict_free(&tmp);
|
||||
if (s->pb && !(s->flags & AVFMT_FLAG_CUSTOM_IO))
|
||||
avio_closep(&s->pb);
|
||||
ff_format_io_close(s, &s->pb);
|
||||
avformat_free_context(s);
|
||||
*ps = NULL;
|
||||
return ret;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#include "version_major.h"
|
||||
|
||||
#define LIBAVFORMAT_VERSION_MINOR 16
|
||||
#define LIBAVFORMAT_VERSION_MICRO 100
|
||||
#define LIBAVFORMAT_VERSION_MICRO 101
|
||||
|
||||
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
|
||||
LIBAVFORMAT_VERSION_MINOR, \
|
||||
|
||||
Reference in New Issue
Block a user