On Fri, 17 Jun 2016, sebechlebsky...@gmail.com wrote:

From: Jan Sebechlebsky <sebechlebsky...@gmail.com>

Signed-off-by: Jan Sebechlebsky <sebechlebsky...@gmail.com>
---
I've missed that - sorry, should be fixed in this patch.


[...]

static int open_slave(AVFormatContext *avf, char *slave, TeeSlave *tee_slave)
@@ -443,24 +442,26 @@ static int tee_write_header(AVFormatContext *avf)
    TeeContext *tee = avf->priv_data;
    unsigned nb_slaves = 0, i;
    const char *filename = avf->filename;
-    char *slaves[MAX_SLAVES];
+    char **slaves = NULL;
    int ret;

    while (*filename) {
-        if (nb_slaves == MAX_SLAVES) {
-            av_log(avf, AV_LOG_ERROR, "Maximum %d slave muxers reached.\n",
-                   MAX_SLAVES);
-            ret = AVERROR_PATCHWELCOME;
-            goto fail;
-        }
-        if (!(slaves[nb_slaves++] = av_get_token(&filename, slave_delim))) {
+        char *slave = av_get_token(&filename, slave_delim);
+        if (!slave) {
            ret = AVERROR(ENOMEM);
            goto fail;
        }
+        ret = av_dynarray_add_nofree(&slaves, &nb_slaves, slave);
+        if (ret < 0)
+            goto fail;

Aren't you still leaking slave here on error?

Thanks,
Marton
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to