Verified Commit ece7d1f1 authored by Max Rees's avatar Max Rees

user/ffmpeg: patch CVE-2019-13312 and CVE-2020-12284 (#156)

parent f0b42a82
......@@ -4,7 +4,7 @@
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=ffmpeg
pkgver=4.2.2
pkgrel=0
pkgrel=1
pkgdesc="Record, convert, and stream audio and video"
url="https://ffmpeg.org/"
arch="all"
......@@ -21,6 +21,8 @@ makedepends="alsa-lib-dev bzip2-dev freetype-dev gnutls-dev imlib2-dev
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs"
source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
CVE-2019-13312.patch
CVE-2020-12284.patch
"
# secfixes:
......@@ -37,6 +39,9 @@ source="https://ffmpeg.org/releases/ffmpeg-$pkgver.tar.xz
# - CVE-2017-14222
# - CVE-2017-14223
# - CVE-2017-14225
# 4.2.2-r1:
# - CVE-2019-13312
# - CVE-2020-12284
build() {
_asm=""
......@@ -98,4 +103,6 @@ libs() {
}
sha512sums="381cd6732fa699eb89000621cf34256920596ed1f9de3c2194dbad35fdf2165269eb7d3a147a0eb75dc18fbb6d601382b5801750e09fc63547766842f84208e3 ffmpeg-4.2.2.tar.xz
1047a23eda51b576ac200d5106a1cd318d1d5291643b3a69e025c0a7b6f3dbc9f6eb0e1e6faa231b7e38c8dd4e49a54f7431f87a93664da35825cc2e9e8aedf4 0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch"
1047a23eda51b576ac200d5106a1cd318d1d5291643b3a69e025c0a7b6f3dbc9f6eb0e1e6faa231b7e38c8dd4e49a54f7431f87a93664da35825cc2e9e8aedf4 0001-libavutil-clean-up-unused-FF_SYMVER-macro.patch
0c53680ae480b8f848893d4e5c40ea522bd25a72860e0955e039ec838ee09159ab2bfa0eafc71113009082c7f53981ba70116dcef17053cd3cc3ea59e4da5a5c CVE-2019-13312.patch
910f8da9ed8e0998c311cc451f1725a20c4cc3e9f0c2d1981a1ceea8da5f434519044b4997e71d87424e19fcc45cb203238e49ad178e313696667e6c9bf311c9 CVE-2020-12284.patch"
From ea56af88956061d700043c5c4b026ac57834b0c8 Mon Sep 17 00:00:00 2001
From: Carl Eugen Hoyos <ceffmpeg@gmail.com>
Date: Mon, 1 Jul 2019 01:45:36 +0200
Subject: [PATCH] lavc/zmbvenc: Do not left-shift negative values.
Fixes the following ubsan errors with the sample from ticket #7980:
libavcodec/zmbvenc.c:243:29: runtime error: left shift of negative value -4
libavcodec/zmbvenc.c:244:28: runtime error: left shift of negative value -2
---
libavcodec/zmbvenc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c
index 4887175..0e22ce6 100644
--- a/libavcodec/zmbvenc.c
+++ b/libavcodec/zmbvenc.c
@@ -240,8 +240,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
tprev = prev + x * c->bypp;
zmbv_me(c, tsrc, p->linesize[0], tprev, c->pstride, x, y, &mx, &my, &xored);
- mv[0] = (mx << 1) | !!xored;
- mv[1] = my << 1;
+ mv[0] = (mx * 2) | !!xored;
+ mv[1] = my * 2;
tprev += mx * c->bypp + my * c->pstride;
if(xored){
for(j = 0; j < bh2; j++){
--
2.7.4
From 1812352d767ccf5431aa440123e2e260a4db2726 Mon Sep 17 00:00:00 2001
From: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat, 7 Mar 2020 15:42:58 +0100
Subject: [PATCH] avcodec/cbs_jpeg: Check length for SOS
Fixes: out of array access
Fixes: 19734/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5673507031875584
Fixes: 19353/clusterfuzz-testcase-minimized-ffmpeg_BSF_TRACE_HEADERS_fuzzer-5703944462663680
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
libavcodec/cbs_jpeg.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/libavcodec/cbs_jpeg.c b/libavcodec/cbs_jpeg.c
index 6bbce5f..89512a2 100644
--- a/libavcodec/cbs_jpeg.c
+++ b/libavcodec/cbs_jpeg.c
@@ -197,6 +197,9 @@ static int cbs_jpeg_split_fragment(CodedBitstreamContext *ctx,
if (marker == JPEG_MARKER_SOS) {
length = AV_RB16(frag->data + start);
+ if (length > end - start)
+ return AVERROR_INVALIDDATA;
+
data_ref = NULL;
data = av_malloc(end - start +
AV_INPUT_BUFFER_PADDING_SIZE);
--
2.7.4
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment