diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2012-04-27 10:53:04 -0700 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2012-04-27 14:03:43 -0700 |
commit | e1e146a2d139bbc7e10b6ade68bf99abf285d6ad (patch) | |
tree | 722576682bf836a545737e5c322a7dc73b725fbe /libavformat | |
parent | 546adc1fee1f6975af2cebb91307b8415dfa9172 (diff) | |
download | ffmpeg-e1e146a2d139bbc7e10b6ade68bf99abf285d6ad.tar.gz |
avio: make avio_close(NULL) a no-op
Its behaviour in line with ffurl_close(NULL).
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aviobuf.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 01a36475b2..0353a17379 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); |