diff options
Diffstat (limited to 'meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch')
-rw-r--r-- | meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch | 99 |
1 files changed, 0 insertions, 99 deletions
diff --git a/meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch b/meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch deleted file mode 100644 index 94213a74ef..0000000000 --- a/meta/recipes-multimedia/libav/libav/libav-fix-CVE-2014-9676.patch +++ /dev/null | |||
@@ -1,99 +0,0 @@ | |||
1 | Upstream-Status: Backport | ||
2 | CVE: CVE-2014-9676 | ||
3 | |||
4 | Backport patch to fix CVE-2014-9676. | ||
5 | |||
6 | https://security-tracker.debian.org/tracker/CVE-2014-9676 | ||
7 | https://git.libav.org/?p=libav.git;a=commit;h=b3f04657368a32a9903406395f865e230b1de348 | ||
8 | |||
9 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
10 | --- | ||
11 | From b3f04657368a32a9903406395f865e230b1de348 Mon Sep 17 00:00:00 2001 | ||
12 | From: Luca Barbato <lu_zero@gentoo.org> | ||
13 | Date: Mon, 5 Jan 2015 10:40:41 +0100 | ||
14 | Subject: [PATCH] segment: Fix the failure paths | ||
15 | |||
16 | A failure in segment_end() or segment_start() would lead to freeing | ||
17 | a dangling pointer and in general further calls to seg_write_packet() | ||
18 | or to seg_write_trailer() would have the same faulty behaviour. | ||
19 | |||
20 | CC: libav-stable@libav.org | ||
21 | Reported-By: luodalongde@gmail.com | ||
22 | --- | ||
23 | libavformat/segment.c | 32 ++++++++++++++++++++------------ | ||
24 | 1 file changed, 20 insertions(+), 12 deletions(-) | ||
25 | |||
26 | diff --git a/libavformat/segment.c b/libavformat/segment.c | ||
27 | index 52da6b9..bcfd1f9 100644 | ||
28 | --- a/libavformat/segment.c | ||
29 | +++ b/libavformat/segment.c | ||
30 | @@ -184,6 +184,13 @@ static void close_null_ctx(AVIOContext *pb) | ||
31 | av_free(pb); | ||
32 | } | ||
33 | |||
34 | +static void seg_free_context(SegmentContext *seg) | ||
35 | +{ | ||
36 | + avio_closep(&seg->pb); | ||
37 | + avformat_free_context(seg->avf); | ||
38 | + seg->avf = NULL; | ||
39 | +} | ||
40 | + | ||
41 | static int seg_write_header(AVFormatContext *s) | ||
42 | { | ||
43 | SegmentContext *seg = s->priv_data; | ||
44 | @@ -265,12 +272,9 @@ static int seg_write_header(AVFormatContext *s) | ||
45 | } | ||
46 | |||
47 | fail: | ||
48 | - if (ret) { | ||
49 | - if (seg->list) | ||
50 | - avio_close(seg->pb); | ||
51 | - if (seg->avf) | ||
52 | - avformat_free_context(seg->avf); | ||
53 | - } | ||
54 | + if (ret < 0) | ||
55 | + seg_free_context(seg); | ||
56 | + | ||
57 | return ret; | ||
58 | } | ||
59 | |||
60 | @@ -282,6 +286,9 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) | ||
61 | int64_t end_pts = seg->recording_time * seg->number; | ||
62 | int ret, can_split = 1; | ||
63 | |||
64 | + if (!oc) | ||
65 | + return AVERROR(EINVAL); | ||
66 | + | ||
67 | if (seg->has_video) { | ||
68 | can_split = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && | ||
69 | pkt->flags & AV_PKT_FLAG_KEY; | ||
70 | @@ -322,11 +329,8 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) | ||
71 | ret = ff_write_chained(oc, pkt->stream_index, pkt, s); | ||
72 | |||
73 | fail: | ||
74 | - if (ret < 0) { | ||
75 | - if (seg->list) | ||
76 | - avio_close(seg->pb); | ||
77 | - avformat_free_context(oc); | ||
78 | - } | ||
79 | + if (ret < 0) | ||
80 | + seg_free_context(seg); | ||
81 | |||
82 | return ret; | ||
83 | } | ||
84 | @@ -335,7 +339,11 @@ static int seg_write_trailer(struct AVFormatContext *s) | ||
85 | { | ||
86 | SegmentContext *seg = s->priv_data; | ||
87 | AVFormatContext *oc = seg->avf; | ||
88 | - int ret; | ||
89 | + int ret = 0; | ||
90 | + | ||
91 | + if (!oc) | ||
92 | + goto fail; | ||
93 | + | ||
94 | if (!seg->write_header_trailer) { | ||
95 | if ((ret = segment_end(oc, 0)) < 0) | ||
96 | goto fail; | ||
97 | -- | ||
98 | 2.4.1.314.g9532ead | ||
99 | |||