changeset 2757:39cac1b7296e libavformat

Call prot->url_close only if it is present.
author alex
date Fri, 16 Nov 2007 00:14:48 +0000
parents 8258fb5a6aa0
children ea55b48f3fbd
files avio.c
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/avio.c	Fri Nov 16 00:09:34 2007 +0000
+++ b/avio.c	Fri Nov 16 00:14:48 2007 +0000
@@ -132,10 +132,11 @@
 
 int url_close(URLContext *h)
 {
-    int ret;
+    int ret = 0;
     if (!h) return 0; /* can happen when url_open fails */
 
-    ret = h->prot->url_close(h);
+    if (h->prot->url_close)
+        ret = h->prot->url_close(h);
     av_free(h);
     return ret;
 }