]> granicus.if.org Git - handbrake/commitdiff
muxavformat: fix crash on windows
authorJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 15 Jun 2018 20:16:00 +0000 (13:16 -0700)
committerJohn Stebbins <jstebbins.hb@gmail.com>
Fri, 15 Jun 2018 20:17:32 +0000 (13:17 -0700)
We allocate AVFormatContext.url, but libavformat frees it.  So we must
use an allocation function that is compatible with the free function
used by libavformat.

libhb/muxavformat.c

index d4f94356a3d4cd77421b9a73eb36e2b98a69d24c..f8a0ab984f179eef148d12bbded4dc50a3452884 100644 (file)
@@ -182,7 +182,7 @@ static int avformatInit( hb_mux_object_t * m )
         hb_error("Could not guess output format %s", muxer_name);
         goto error;
     }
-    m->oc->url = strdup(job->file);
+    m->oc->url = av_strdup(job->file);
     ret = avio_open2(&m->oc->pb, job->file, AVIO_FLAG_WRITE,
                      &m->oc->interrupt_callback, NULL);
     if( ret < 0 )