diff options
Diffstat (limited to 'meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2021-38291.patch')
-rw-r--r-- | meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2021-38291.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2021-38291.patch b/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2021-38291.patch new file mode 100644 index 0000000000..e5be985fc3 --- /dev/null +++ b/meta/recipes-multimedia/ffmpeg/ffmpeg/CVE-2021-38291.patch | |||
@@ -0,0 +1,53 @@ | |||
1 | From e01d306c647b5827102260b885faa223b646d2d1 Mon Sep 17 00:00:00 2001 | ||
2 | From: James Almer <jamrial@gmail.com> | ||
3 | Date: Wed, 21 Jul 2021 01:02:44 -0300 | ||
4 | Subject: [PATCH] avcodec/utils: don't return negative values in | ||
5 | av_get_audio_frame_duration() | ||
6 | |||
7 | In some extrme cases, like with adpcm_ms samples with an extremely high channel | ||
8 | count, get_audio_frame_duration() may return a negative frame duration value. | ||
9 | Don't propagate it, and instead return 0, signaling that a duration could not | ||
10 | be determined. | ||
11 | |||
12 | CVE: CVE-2021-3566 | ||
13 | Fixes ticket #9312 | ||
14 | Signed-off-by: James Almer <jamrial@gmail.com> | ||
15 | Signed-off-by: Saloni Jain <salonij@kpit.com> | ||
16 | |||
17 | Upstream-Status: Backport [http://git.videolan.org/?p=ffmpeg.git;a=patch;h=e01d306c647b5827102260b885faa223b646d2d1] | ||
18 | Comment: No changes/refreshing done. | ||
19 | --- | ||
20 | libavcodec/utils.c | 6 ++++-- | ||
21 | 1 file changed, 4 insertions(+), 2 deletions(-) | ||
22 | |||
23 | diff --git a/libavcodec/utils.c b/libavcodec/utils.c | ||
24 | index 5fad782f5a..cfc07cbcb8 100644 | ||
25 | --- a/libavcodec/utils.c | ||
26 | +++ b/libavcodec/utils.c | ||
27 | @@ -810,20 +810,22 @@ static int get_audio_frame_duration(enum AVCodecID id, int sr, int ch, int ba, | ||
28 | |||
29 | int av_get_audio_frame_duration(AVCodecContext *avctx, int frame_bytes) | ||
30 | { | ||
31 | - return get_audio_frame_duration(avctx->codec_id, avctx->sample_rate, | ||
32 | + int duration = get_audio_frame_duration(avctx->codec_id, avctx->sample_rate, | ||
33 | avctx->channels, avctx->block_align, | ||
34 | avctx->codec_tag, avctx->bits_per_coded_sample, | ||
35 | avctx->bit_rate, avctx->extradata, avctx->frame_size, | ||
36 | frame_bytes); | ||
37 | + return FFMAX(0, duration); | ||
38 | } | ||
39 | |||
40 | int av_get_audio_frame_duration2(AVCodecParameters *par, int frame_bytes) | ||
41 | { | ||
42 | - return get_audio_frame_duration(par->codec_id, par->sample_rate, | ||
43 | + int duration = get_audio_frame_duration(par->codec_id, par->sample_rate, | ||
44 | par->channels, par->block_align, | ||
45 | par->codec_tag, par->bits_per_coded_sample, | ||
46 | par->bit_rate, par->extradata, par->frame_size, | ||
47 | frame_bytes); | ||
48 | + return FFMAX(0, duration); | ||
49 | } | ||
50 | |||
51 | #if !HAVE_THREADS | ||
52 | -- | ||
53 | 2.20.1 | ||