[vlc-commits] Contribs: fix a crash in ffmpeg/ape

Jean-Baptiste Kempf git at videolan.org
Wed Mar 16 13:32:34 CET 2011


vlc/vlc-1.1 | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Mar 16 13:28:51 2011 +0100| [adf44c9b97b9617150baba9234b739147861725d] | committer: Jean-Baptiste Kempf

Contribs: fix a crash in ffmpeg/ape

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.1.git/?a=commit;h=adf44c9b97b9617150baba9234b739147861725d
---

 extras/contrib/src/Makefile                        |    5 +++++
 extras/contrib/src/Patches/libavformat-ape.c.patch |   17 +++++++++++++++++
 2 files changed, 22 insertions(+), 0 deletions(-)

diff --git a/extras/contrib/src/Makefile b/extras/contrib/src/Makefile
index 0e0661b..8028b4c 100644
--- a/extras/contrib/src/Makefile
+++ b/extras/contrib/src/Makefile
@@ -1070,6 +1070,11 @@ ifdef HAVE_UCLIBC
 	patch -p0 < Patches/ffmpeg-svn-internal-define.patch
 	patch -p0 < Patches/ffmpeg-svn-libavformat.patch
 endif
+ifdef HAVE_WIN32
+	sed -i "s/std=c99/std=gnu99/" ffmpeg/configure
+endif
+	(cd ffmpeg; patch -p1 < ../Patches/libavformat-ape.c.patch )
+
 else
 ffmpeg-$(FFMPEG_VERSION).tar.gz:
 	echo "ffmpeg snapshot is too old, you MUST use subversion !"
diff --git a/extras/contrib/src/Patches/libavformat-ape.c.patch b/extras/contrib/src/Patches/libavformat-ape.c.patch
new file mode 100644
index 0000000..ab05cfc
--- /dev/null
+++ b/extras/contrib/src/Patches/libavformat-ape.c.patch
@@ -0,0 +1,17 @@
+X-Git-Url: http://git.videolan.org/?p=ffmpeg.git;a=blobdiff_plain;f=libavformat%2Fape.c;h=187c9865a4fce398c7a4b4b19aad0a59b281a469;hp=2de47ef483245372a9a3c56656cd48a30a383856;hb=1c31b26bdf66879a46a7a3e340da815c1b2125a8;hpb=6947b0c42e0649f0c8355442d1732d642e467902
+
+diff --git a/libavformat/ape.c b/libavformat/ape.c
+index 2de47ef..187c986 100644
+--- a/libavformat/ape.c
++++ b/libavformat/ape.c
+@@ -242,6 +242,10 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
+             avio_seek(pb, ape->wavheaderlength, SEEK_CUR);
+     }
+ 
++    if(!ape->totalframes){
++        av_log(s, AV_LOG_ERROR, "No frames in the file!\n");
++        return AVERROR(EINVAL);
++    }
+     if(ape->totalframes > UINT_MAX / sizeof(APEFrame)){
+         av_log(s, AV_LOG_ERROR, "Too many frames: %d\n", ape->totalframes);
+         return -1;



More information about the vlc-commits mailing list