summaryrefslogtreecommitdiffstats
path: root/vlc
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2012-12-12 11:20:13 +0000
committer Eric Hameleers <alien@slackware.com>2012-12-12 11:20:13 +0000
commit98972e67883758a8184001acdce76af5580676b6 (patch)
tree1304f5524d8d53738d3f3c546d92de3b41b7f806 /vlc
parent0f4f12b8676462407824de5918f503d8f6d21e2d (diff)
downloadasb-98972e67883758a8184001acdce76af5580676b6.tar.gz
asb-98972e67883758a8184001acdce76af5580676b6.tar.xz
Initial revision
Diffstat (limited to 'vlc')
-rw-r--r--vlc/build/ffmpeg_libavcodec_a25d912.patch28
-rw-r--r--vlc/build/ffmpeg_swfdec.patch81
2 files changed, 109 insertions, 0 deletions
diff --git a/vlc/build/ffmpeg_libavcodec_a25d912.patch b/vlc/build/ffmpeg_libavcodec_a25d912.patch
new file mode 100644
index 00000000..5f221794
--- /dev/null
+++ b/vlc/build/ffmpeg_libavcodec_a25d912.patch
@@ -0,0 +1,28 @@
+From: =?utf8?q?Rafa=C3=ABl=20Carr=C3=A9?= <funman@videolan.org>
+Date: Mon, 15 Oct 2012 18:41:55 +0200
+Subject: [PATCH] avcodec_encode_audio(): fix invalid free
+
+Since 2bc0de385, AVFrame needs to be initialized
+before calling avcodec_get_frame_defaults().
+
+Signed-off-by: Anton Khirnov <anton@khirnov.net>
+---
+ libavcodec/utils.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libavcodec/utils.c b/libavcodec/utils.c
+index bb99a5a..836d953 100644
+--- a/libavcodec/utils.c
++++ b/libavcodec/utils.c
+@@ -1073,7 +1073,7 @@ int attribute_align_arg avcodec_encode_audio(AVCodecContext *avctx,
+ const short *samples)
+ {
+ AVPacket pkt;
+- AVFrame frame0;
++ AVFrame frame0 = { 0 };
+ AVFrame *frame;
+ int ret, samples_size, got_packet;
+
+--
+1.7.2.5
+
diff --git a/vlc/build/ffmpeg_swfdec.patch b/vlc/build/ffmpeg_swfdec.patch
new file mode 100644
index 00000000..160c0398
--- /dev/null
+++ b/vlc/build/ffmpeg_swfdec.patch
@@ -0,0 +1,81 @@
+--- libavformat/swfdec.c.orig 2012-10-02 14:58:19.000000000 +0200
++++ libavformat/swfdec.c 2012-12-12 12:17:34.480049142 +0100
+@@ -151,7 +151,11 @@
+ uint64_t pos = avio_tell(pb);
+ tag = get_swf_tag(pb, &len);
+ if (tag < 0)
+- return tag;
++ return AVERROR(EIO);
++ if (len < 0) {
++ av_log(s, AV_LOG_ERROR, "invalid tag length: %d\n", len);
++ return AVERROR_INVALIDDATA;
++ }
+ if (tag == TAG_VIDEOSTREAM) {
+ int ch_id = avio_rl16(pb);
+ len -= 2;
+@@ -207,7 +211,10 @@
+ st = s->streams[i];
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) {
+ frame = avio_rl16(pb);
+- if ((res = av_get_packet(pb, pkt, len-2)) < 0)
++ len -= 2;
++ if (len <= 0)
++ goto skip;
++ if ((res = av_get_packet(pb, pkt, len)) < 0)
+ return res;
+ pkt->pos = pos;
+ pkt->pts = frame;
+@@ -219,17 +226,22 @@
+ for (i = 0; i < s->nb_streams; i++) {
+ st = s->streams[i];
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) {
+- if (st->codec->codec_id == AV_CODEC_ID_MP3) {
+- avio_skip(pb, 4);
+- if ((res = av_get_packet(pb, pkt, len-4)) < 0)
+- return res;
+- } else { // ADPCM, PCM
+- if ((res = av_get_packet(pb, pkt, len)) < 0)
+- return res;
+- }
+- pkt->pos = pos;
+- pkt->stream_index = st->index;
+- return pkt->size;
++ if (st->codec->codec_id == AV_CODEC_ID_MP3) {
++ avio_skip(pb, 4);
++ len -= 4;
++ if (len <= 0)
++ goto skip;
++ if ((res = av_get_packet(pb, pkt, len)) < 0)
++ return res;
++ } else { // ADPCM, PCM
++ if (len <= 0)
++ goto skip;
++ if ((res = av_get_packet(pb, pkt, len)) < 0)
++ return res;
++ }
++ pkt->pos = pos;
++ pkt->stream_index = st->index;
++ return pkt->size;
+ }
+ }
+ } else if (tag == TAG_JPEG2) {
+@@ -249,7 +261,10 @@
+ st = vst;
+ }
+ avio_rl16(pb); /* BITMAP_ID */
+- if ((res = av_new_packet(pkt, len-2)) < 0)
++ len -= 2;
++ if (len < 4)
++ goto skip;
++ if ((res = av_new_packet(pkt, len)) < 0)
+ return res;
+ avio_read(pb, pkt->data, 4);
+ if (AV_RB32(pkt->data) == 0xffd8ffd9 ||
+@@ -266,6 +281,7 @@
+ return pkt->size;
+ }
+ skip:
++ len = FFMAX(0, len);
+ avio_skip(pb, len);
+ }
+ }