unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 4d48da667d6c8a5a1e8d8bc8b0e0b9989b3b540b 4577 bytes (raw)
name: gnu/packages/patches/mpv-CVE-2018-6360-1.patch 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
 
Fix CVE-2018-6360:

https://github.com/mpv-player/mpv/issues/5456
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-6360
https://security-tracker.debian.org/tracker/CVE-2018-6360

Patch copied from upstream source repository:

https://github.com/mpv-player/mpv/commit/828bd2963cd10a851e0a977809687aed4d377dc3

From 828bd2963cd10a851e0a977809687aed4d377dc3 Mon Sep 17 00:00:00 2001
From: Ricardo Constantino <wiiaboo@gmail.com>
Date: Tue, 2 Jan 2018 20:46:58 +0000
Subject: [PATCH] command: add demuxer-lavf-list property

Was only available with --demuxer-lavf-format=help and the demuxer
needed to be used for it to actually print the list.

This can be used in the future to check if 'dash' support was compiled
with FFmpeg so ytdl_hook can use it instead. For now, dashdec is too
rudimentary to be used right away.
---
 DOCS/man/input.rst |  4 ++++
 common/av_common.c | 17 +++++++++++++++++
 common/av_common.h |  1 +
 player/command.c   | 15 +++++++++++++++
 4 files changed, 37 insertions(+)

diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst
index 16d8ecb45d..0ae4a0c0c8 100644
--- a/DOCS/man/input.rst
+++ b/DOCS/man/input.rst
@@ -2119,6 +2119,10 @@ Property list
     The encoder names (``driver`` entries) can be passed to ``--ovc`` and
     ``--oac`` (without the ``lavc:`` prefix required by ``--vd`` and ``--ad``).
 
+``demuxer-lavf-list``
+    List of available libavformat demuxers' names. This can be used to check
+    for support for a specific format or use with ``--demuxer-lavf-format``.
+
 ``mpv-version``
     Return the mpv version/copyright string. Depending on how the binary was
     built, it might contain either a release version, or just a git hash.
diff --git a/common/av_common.c b/common/av_common.c
index 65a212b994..0599d98465 100644
--- a/common/av_common.c
+++ b/common/av_common.c
@@ -26,6 +26,7 @@
 #include <libavutil/error.h>
 #include <libavutil/cpu.h>
 #include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
 
 #include "config.h"
 
@@ -33,6 +34,7 @@
 #include "common/msg.h"
 #include "demux/packet.h"
 #include "demux/stheader.h"
+#include "misc/bstr.h"
 #include "video/fmt-conversion.h"
 #include "av_common.h"
 #include "codecs.h"
@@ -246,6 +248,21 @@ void mp_add_lavc_encoders(struct mp_decoder_list *list)
     }
 }
 
+char **mp_get_lavf_demuxers(void)
+{
+    char **list = NULL;
+    AVInputFormat *cur = NULL;
+    int num = 0;
+    for (;;) {
+        cur = av_iformat_next(cur);
+        if (!cur)
+            break;
+        MP_TARRAY_APPEND(NULL, list, num, talloc_strdup(NULL, cur->name));
+    }
+    MP_TARRAY_APPEND(NULL, list, num, NULL);
+    return list;
+}
+
 int mp_codec_to_av_codec_id(const char *codec)
 {
     int id = AV_CODEC_ID_NONE;
diff --git a/common/av_common.h b/common/av_common.h
index 6d0c823b8d..0e7c838884 100644
--- a/common/av_common.h
+++ b/common/av_common.h
@@ -41,6 +41,7 @@ double mp_pts_from_av(int64_t av_pts, AVRational *tb);
 void mp_set_avcodec_threads(struct mp_log *l, AVCodecContext *avctx, int threads);
 void mp_add_lavc_decoders(struct mp_decoder_list *list, enum AVMediaType type);
 void mp_add_lavc_encoders(struct mp_decoder_list *list);
+char **mp_get_lavf_demuxers(void);
 int mp_codec_to_av_codec_id(const char *codec);
 const char *mp_codec_from_av_codec_id(int codec_id);
 void mp_set_avdict(struct AVDictionary **dict, char **kv);
diff --git a/player/command.c b/player/command.c
index 6f2c15b047..412afc5e11 100644
--- a/player/command.c
+++ b/player/command.c
@@ -3588,6 +3588,20 @@ static int mp_property_encoders(void *ctx, struct m_property *prop,
     return r;
 }
 
+static int mp_property_lavf_demuxers(void *ctx, struct m_property *prop,
+                                 int action, void *arg)
+{
+    switch (action) {
+    case M_PROPERTY_GET:
+        *(char ***)arg = mp_get_lavf_demuxers();
+        return M_PROPERTY_OK;
+    case M_PROPERTY_GET_TYPE:
+        *(struct m_option *)arg = (struct m_option){.type = CONF_TYPE_STRING_LIST};
+        return M_PROPERTY_OK;
+    }
+    return M_PROPERTY_NOT_IMPLEMENTED;
+}
+
 static int mp_property_version(void *ctx, struct m_property *prop,
                                int action, void *arg)
 {
@@ -4027,6 +4041,7 @@ static const struct m_property mp_properties_base[] = {
     {"protocol-list", mp_property_protocols},
     {"decoder-list", mp_property_decoders},
     {"encoder-list", mp_property_encoders},
+    {"demuxer-lavf-list", mp_property_lavf_demuxers},
 
     {"mpv-version", mp_property_version},
     {"mpv-configuration", mp_property_configuration},
-- 
2.16.1


debug log:

solving 4d48da667 ...
found 4d48da667 in https://yhetil.org/guix-patches/87mv0kqb67.fsf@gmail.com/

applying [1/1] https://yhetil.org/guix-patches/87mv0kqb67.fsf@gmail.com/
diff --git a/gnu/packages/patches/mpv-CVE-2018-6360-1.patch b/gnu/packages/patches/mpv-CVE-2018-6360-1.patch
new file mode 100644
index 000000000..4d48da667

1:42: trailing whitespace.
 
1:59: trailing whitespace.
 
1:61: trailing whitespace.
 
1:73: trailing whitespace.
 
1:111: trailing whitespace.
 
Checking patch gnu/packages/patches/mpv-CVE-2018-6360-1.patch...
Applied patch gnu/packages/patches/mpv-CVE-2018-6360-1.patch cleanly.
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.

index at:
100644 4d48da667d6c8a5a1e8d8bc8b0e0b9989b3b540b	gnu/packages/patches/mpv-CVE-2018-6360-1.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).