diff avio.c @ 2710:00ffc2f02705 libavformat

Check context before accessing its field. Patch by Thorsten Jordan: tjordan macrosystem de
author benoit
date Wed, 07 Nov 2007 08:34:00 +0000
parents b21c2af60bc9
children 39cac1b7296e
line wrap: on
line diff
--- a/avio.c	Wed Nov 07 05:35:46 2007 +0000
+++ b/avio.c	Wed Nov 07 08:34:00 2007 +0000
@@ -133,6 +133,7 @@
 int url_close(URLContext *h)
 {
     int ret;
+    if (!h) return 0; /* can happen when url_open fails */
 
     ret = h->prot->url_close(h);
     av_free(h);