mirror of
https://git.yoctoproject.org/poky
synced 2026-05-08 17:19:20 +00:00
ffmpeg: fix CVE-2020-20453
avcodec/aacenc: Avoid 0 lambda Fixes: Ticket8003 Fixes: CVE-2020-20453 (From OE-Core rev: 66478fa2b913f69bcad1a1989f716c9c30953fee) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> CVE: CVE-2020-20453 Upstream-Status: Backport [a7a7f32c8ad0179a1a85d0a8cff35924e6d90be8] Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
7de4c20e62
commit
e3adc62076
@@ -0,0 +1,42 @@
|
||||
From a7a7f32c8ad0179a1a85d0a8cff35924e6d90be8 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Niedermayer <michael@niedermayer.cc>
|
||||
Date: Fri, 28 May 2021 21:37:26 +0200
|
||||
Subject: [PATCH] avcodec/aacenc: Avoid 0 lambda
|
||||
|
||||
Fixes: Ticket8003
|
||||
Fixes: CVE-2020-20453
|
||||
|
||||
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
|
||||
|
||||
CVE: CVE-2020-20453
|
||||
Upstream-Status: Backport [a7a7f32c8ad0179a1a85d0a8cff35924e6d90be8]
|
||||
|
||||
Signed-off-by: Tony Tascioglu <tony.tascioglu@windriver.com>
|
||||
---
|
||||
libavcodec/aacenc.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
|
||||
index aa223cf25f..e80591ba86 100644
|
||||
--- a/libavcodec/aacenc.c
|
||||
+++ b/libavcodec/aacenc.c
|
||||
@@ -28,6 +28,7 @@
|
||||
* TODOs:
|
||||
* add sane pulse detection
|
||||
***********************************/
|
||||
+#include <float.h>
|
||||
|
||||
#include "libavutil/libm.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
@@ -852,7 +853,7 @@ static int aac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
/* Not so fast though */
|
||||
ratio = sqrtf(ratio);
|
||||
}
|
||||
- s->lambda = FFMIN(s->lambda * ratio, 65536.f);
|
||||
+ s->lambda = av_clipf(s->lambda * ratio, FLT_MIN, 65536.f);
|
||||
|
||||
/* Keep iterating if we must reduce and lambda is in the sky */
|
||||
if (ratio > 0.9f && ratio < 1.1f) {
|
||||
--
|
||||
2.32.0
|
||||
|
||||
@@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
|
||||
SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
|
||||
file://0001-libavutil-include-assembly-with-full-path-from-sourc.patch \
|
||||
file://fix-CVE-2020-20446.patch \
|
||||
file://fix-CVE-2020-20453.patch \
|
||||
"
|
||||
SRC_URI[sha256sum] = "06b10a183ce5371f915c6bb15b7b1fffbe046e8275099c96affc29e17645d909"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user