ffmpeg_5: add patches for CVE-2023-49502, CVE-2023-50008, CVE-2023-51793, CVE-2023-51796

This commit is contained in:
Robert Scott
2024-06-10 22:23:51 +01:00
parent f959d366f1
commit 59f7e20118
2 changed files with 42 additions and 0 deletions
@@ -0,0 +1,26 @@
Based on upstream 737ede405b11a37fdd61d19cf25df296a0cb0b75, with cuda and
vulkan implementations removed, bwdif adjusted to apply to 5.1.4
diff --git a/libavfilter/vf_bwdif.c b/libavfilter/vf_bwdif.c
index 65c617ebb3..35c864f71e 100644
--- a/libavfilter/vf_bwdif.c
+++ b/libavfilter/vf_bwdif.c
@@ -333,13 +333,14 @@ static int config_props(AVFilterLink *link)
if(yadif->mode&1)
link->frame_rate = av_mul_q(link->src->inputs[0]->frame_rate, (AVRational){2,1});
- if (link->w < 3 || link->h < 4) {
- av_log(ctx, AV_LOG_ERROR, "Video of less than 3 columns or 4 lines is not supported\n");
+ yadif->csp = av_pix_fmt_desc_get(link->format);
+ yadif->filter = filter;
+
+ if (AV_CEIL_RSHIFT(link->w, yadif->csp->log2_chroma_w) < 3 || AV_CEIL_RSHIFT(link->h, yadif->csp->log2_chroma_h) < 4) {
+ av_log(ctx, AV_LOG_ERROR, "Video with planes less than 3 columns or 4 lines is not supported\n");
return AVERROR(EINVAL);
}
- yadif->csp = av_pix_fmt_desc_get(link->format);
- yadif->filter = filter;
if (yadif->csp->comp[0].depth > 8) {
s->filter_intra = filter_intra_16bit;
s->filter_line = filter_line_c_16bit;
@@ -442,6 +442,22 @@ stdenv.mkDerivation (finalAttrs: {
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/3bb00c0a420c3ce83c6fafee30270d69622ccad7";
hash = "sha256-oZMZysBA+/gwaGEM1yvI+8wCadXWE7qLRL6Emap3b8Q=";
})
./5.1.4-CVE-2023-49502.patch
(fetchpatch2 {
name = "CVE-2023-50008.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/5f87a68cf70dafeab2fb89b42e41a4c29053b89b";
hash = "sha256-sqUUSOPTPLwu2h8GbAw4SfEf+0oWioz52BcpW1n4v3Y=";
})
(fetchpatch2 {
name = "CVE-2023-51793.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/8b8b4bdef311f88c0075a06a25320187aff00bf2";
hash = "sha256-e7oGyOfUXuA8XK3vfygNtFlHpHl92O2KSLAo50sNJ5o=";
})
(fetchpatch2 {
name = "CVE-2023-51796.patch";
url = "https://git.ffmpeg.org/gitweb/ffmpeg.git/patch/e01a55c5283b82667dad347331816a5e20869ce9";
hash = "sha256-m4rq+UFG3nXdgOJ3S6XcruMZ+CPw+twmy2HFv3cnvJc=";
})
]
++ optionals (lib.versionAtLeast version "6.1" && lib.versionOlder version "6.2") [
(fetchpatch2 { # this can be removed post 6.1