[SCM] libav/master: Add upstream patch: mathematics: remove asserts from av_rescale_rnd.
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Wed Jan 22 13:16:39 UTC 2014
The following commit has been merged in the master branch:
commit 1389f786835fce3ee6110caff0467e4f8ae942d8
Author: Reinhard Tartler <siretart at tauware.de>
Date: Tue Jan 21 20:37:09 2014 -0500
Add upstream patch: mathematics: remove asserts from av_rescale_rnd.
Closes: #718805
diff --git a/debian/patches/mathematics-remove-asserts-from-av_rescale_rnd.patch b/debian/patches/mathematics-remove-asserts-from-av_rescale_rnd.patch
new file mode 100644
index 0000000..51a82ee
--- /dev/null
+++ b/debian/patches/mathematics-remove-asserts-from-av_rescale_rnd.patch
@@ -0,0 +1,38 @@
+From 94a417acc05cc5151b473abc0bf51fad26f8c5a0 Mon Sep 17 00:00:00 2001
+From: Anton Khirnov <anton at khirnov.net>
+Date: Thu, 12 Dec 2013 07:34:13 +0100
+Subject: [PATCH] mathematics: remove asserts from av_rescale_rnd()
+
+It is a public function, it must not assert on its parameters.
+---
+ libavutil/mathematics.c | 7 +++----
+ 1 file changed, 3 insertions(+), 4 deletions(-)
+
+diff --git a/libavutil/mathematics.c b/libavutil/mathematics.c
+index 137683e..1a38f64 100644
+--- a/libavutil/mathematics.c
++++ b/libavutil/mathematics.c
+@@ -23,7 +23,6 @@
+ * miscellaneous math routines and tables
+ */
+
+-#include <assert.h>
+ #include <stdint.h>
+ #include <limits.h>
+
+@@ -58,9 +57,9 @@ int64_t av_gcd(int64_t a, int64_t b){
+
+ int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd){
+ int64_t r=0;
+- assert(c > 0);
+- assert(b >=0);
+- assert((unsigned)rnd<=5 && rnd!=4);
++
++ if (c <= 0 || b < 0 || rnd == 4 || rnd > 5)
++ return INT64_MIN;
+
+ if(a<0 && a != INT64_MIN) return -av_rescale_rnd(-a, b, c, rnd ^ ((rnd>>1)&1));
+
+--
+1.8.1.2
+
diff --git a/debian/patches/series b/debian/patches/series
index eb26d9a..b89e7b2 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ makeinfo.patch
spelling-errors.patch
freetype-api.patch
support-opus-in-ogg.patch
+mathematics-remove-asserts-from-av_rescale_rnd.patch
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list