[FFmpeg-cvslog] avfilter/af_surround: check for invalid magnitude and phase difference
Paul B Mahol
git at videolan.org
Wed Apr 24 23:57:14 EEST 2019
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Apr 24 14:36:59 2019 +0200| [2d16b83824c12b4cb3049c4dce7c9542e40a3a68] | committer: Paul B Mahol
avfilter/af_surround: check for invalid magnitude and phase difference
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2d16b83824c12b4cb3049c4dce7c9542e40a3a68
---
libavfilter/af_surround.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavfilter/af_surround.c b/libavfilter/af_surround.c
index bae13322bb..bccea2b938 100644
--- a/libavfilter/af_surround.c
+++ b/libavfilter/af_surround.c
@@ -18,6 +18,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "libavutil/avassert.h"
#include "libavutil/audio_fifo.h"
#include "libavutil/channel_layout.h"
#include "libavutil/opt.h"
@@ -335,6 +336,8 @@ static void stereo_transform(float *x, float *y, float angle)
static void stereo_position(float a, float p, float *x, float *y)
{
+ av_assert2(a >= -1.f && a <= 1.f);
+ av_assert2(p >= 0.f && p <= M_PI);
*x = av_clipf(a+FFMAX(0, sinf(p-M_PI_2))*FFDIFFSIGN(a,0), -1, 1);
*y = av_clipf(cosf(a*M_PI_2+M_PI)*cosf(M_PI_2-p/M_PI)*M_LN10+1, -1, 1);
}
More information about the ffmpeg-cvslog
mailing list