[FFmpeg-cvslog] avio: make avio_close(NULL) a no-op
Luca Barbato
git at videolan.org
Sat Apr 28 21:10:20 CEST 2012
ffmpeg | branch: master | Luca Barbato <lu_zero at gentoo.org> | Fri Apr 27 10:53:04 2012 -0700| [e1e146a2d139bbc7e10b6ade68bf99abf285d6ad] | committer: Luca Barbato
avio: make avio_close(NULL) a no-op
Its behaviour in line with ffurl_close(NULL).
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e1e146a2d139bbc7e10b6ade68bf99abf285d6ad
---
libavformat/aviobuf.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 01a3647..0353a17 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -756,8 +756,12 @@ int avio_open2(AVIOContext **s, const char *filename, int flags,
int avio_close(AVIOContext *s)
{
- URLContext *h = s->opaque;
+ URLContext *h;
+
+ if (!s)
+ return 0;
+ h = s->opaque;
av_free(s->buffer);
av_free(s);
return ffurl_close(h);
More information about the ffmpeg-cvslog
mailing list