]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/avio.c
lavf: use av_freep() in ffurl_close()
[ffmpeg] / libavformat / avio.c
index e732d1ad4a632b496b1940914b9b68d46167c43d..5a1c79ec8ea37b87c6f2b9cc22e105932f82d02b 100644 (file)
@@ -302,7 +302,7 @@ int ffurl_write(URLContext *h, const unsigned char *buf, int size)
     if (h->max_packet_size && size > h->max_packet_size)
         return AVERROR(EIO);
 
-    return retry_transfer_wrapper(h, buf, size, size, (void*)h->prot->url_write);
+    return retry_transfer_wrapper(h, (unsigned char *)buf, size, size, (void*)h->prot->url_write);
 }
 
 int64_t ffurl_seek(URLContext *h, int64_t pos, int whence)
@@ -329,7 +329,7 @@ int ffurl_close(URLContext *h)
     if (h->prot->priv_data_size) {
         if (h->prot->priv_data_class)
             av_opt_free(h->priv_data);
-        av_free(h->priv_data);
+        av_freep(&h->priv_data);
     }
     av_free(h);
     return ret;
@@ -376,6 +376,13 @@ int ffurl_get_file_handle(URLContext *h)
     return h->prot->url_get_file_handle(h);
 }
 
+int ffurl_shutdown(URLContext *h, int flags)
+{
+    if (!h->prot->url_shutdown)
+        return AVERROR(EINVAL);
+    return h->prot->url_shutdown(h, flags);
+}
+
 int ff_check_interrupt(AVIOInterruptCB *cb)
 {
     int ret;