[SCM] ffmpeg/master: Fix heap-buffer-overflows when using libopenmpt.
aca-guest at users.alioth.debian.org
aca-guest at users.alioth.debian.org
Sat Jan 21 23:05:11 UTC 2017
The following commit has been merged in the master branch:
commit 256228bcfe10df8d0ee9bd17943d87fc489095e7
Author: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
Date: Sat Jan 21 22:30:09 2017 +0100
Fix heap-buffer-overflows when using libopenmpt.
diff --git a/debian/patches/libopenmpt-add-missing-avio_read-return-value-check.patch b/debian/patches/libopenmpt-add-missing-avio_read-return-value-check.patch
new file mode 100644
index 0000000..c7b5d3c
--- /dev/null
+++ b/debian/patches/libopenmpt-add-missing-avio_read-return-value-check.patch
@@ -0,0 +1,33 @@
+From: Andreas Cadhalpun <andreas.cadhalpun at googlemail.com>
+Date: Sun, 1 Jan 2017 20:27:50 +0100
+Subject: libopenmpt: add missing avio_read return value check
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+This fixes heap-buffer-overflows in libopenmpt caused by interpreting
+the negative size value as unsigned size_t.
+
+Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun at googlemail.com>
+Reviewed-by: Jörn Heusipp <osmanx at problemloesungsmaschine.de>
+Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
+---
+ libavformat/libopenmpt.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/libavformat/libopenmpt.c b/libavformat/libopenmpt.c
+index e7091ef9..35fd28f5 100644
+--- a/libavformat/libopenmpt.c
++++ b/libavformat/libopenmpt.c
+@@ -82,6 +82,11 @@ static int read_header_openmpt(AVFormatContext *s)
+ if (!buf)
+ return AVERROR(ENOMEM);
+ size = avio_read(s->pb, buf, size);
++ if (size < 0) {
++ av_log(s, AV_LOG_ERROR, "Reading input buffer failed.\n");
++ av_freep(&buf);
++ return size;
++ }
+
+ openmpt->module = openmpt_module_create_from_memory(buf, size, openmpt_logfunc, s, NULL);
+ av_freep(&buf);
diff --git a/debian/patches/series b/debian/patches/series
index 11370f2..15af50c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
lavf-chromaprint-Update-for-version-1.4.patch
swscale-save-ebx-register-when-it-is-not-available.patch
+libopenmpt-add-missing-avio_read-return-value-check.patch
--
ffmpeg packaging
More information about the pkg-multimedia-commits
mailing list