libavformat/mux.c:601: error: Uninitialized Value
  The value read from ret was never initialized.

libavformat/mux.c:601:5: 
599.         av_opt_free(s->priv_data);
600.     av_freep(&s->priv_data);
601.     return ret;
         ^
602. }

int av_write_trailer(AVFormatContext *s)
{
    int ret, i;
    for (;; ) {
        AVPacket pkt;
        ret = interleave_packet(s, &pkt, NULL, 1);
        if (ret < 0)
            goto fail;
        if (!ret)
            break;
        ret = s->oformat->write_packet(s, &pkt);
        if (ret >= 0)
            s->streams[pkt.stream_index]->nb_frames++;
        av_free_packet(&pkt);
        if (ret < 0)
            goto fail;
    }
    if (s->oformat->write_trailer)
        ret = s->oformat->write_trailer(s);
    if (!(s->oformat->flags & AVFMT_NOFILE))
        avio_flush(s->pb);
fail:
    for (i = 0; i < s->nb_streams; i++) {
        av_freep(&s->streams[i]->priv_data);
        av_freep(&s->streams[i]->index_entries);
    }
    if (s->oformat->priv_class)
        av_opt_free(s->priv_data);
    av_freep(&s->priv_data);
    return ret;
}
['int av_write_trailer(AVFormatContext *s)\n{\n    int ret, i;\n    for (;; ) {\n        AVPacket pkt;\n        ret = interleave_packet(s, &pkt, NULL, 1);\n        if (ret < 0)\n            goto fail;\n        if (!ret)\n            break;\n        ret = s->oformat->write_packet(s, &pkt);\n        if (ret >= 0)\n            s->streams[pkt.stream_index]->nb_frames++;\n        av_free_packet(&pkt);\n        if (ret < 0)\n            goto fail;\n    }\n    if (s->oformat->write_trailer)\n        ret = s->oformat->write_trailer(s);\n    if (!(s->oformat->flags & AVFMT_NOFILE))\n        avio_flush(s->pb);\nfail:\n    for (i = 0; i < s->nb_streams; i++) {\n        av_freep(&s->streams[i]->priv_data);\n        av_freep(&s->streams[i]->index_entries);\n    }\n    if (s->oformat->priv_class)\n        av_opt_free(s->priv_data);\n    av_freep(&s->priv_data);\n    return ret;\n}']