From c9f1dab468a1588cf4e6bba07b2b1ca4ee470f06 Mon Sep 17 00:00:00 2001 From: lifegpc Date: Thu, 24 Oct 2024 19:28:22 +0800 Subject: [PATCH] patch ffmpeg --- .github/workflows/deno.yml | 1 + Dockerfile | 4 +++- patch/ffmpeg/imgutils.patch | 11 +++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 patch/ffmpeg/imgutils.patch diff --git a/.github/workflows/deno.yml b/.github/workflows/deno.yml index 3d7f63d..f4b4f39 100644 --- a/.github/workflows/deno.yml +++ b/.github/workflows/deno.yml @@ -18,6 +18,7 @@ on: - docker_entrypoint.sh - docker-compose.yml - '**.md' + - patch/ permissions: contents: read diff --git a/Dockerfile b/Dockerfile index fc1eb19..ca02152 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,8 @@ RUN apt-get update && apt-get install -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +COPY ./patch ~/patch + RUN cd ~ && \ curl -L "https://github.com/webmproject/libwebp/archive/refs/tags/v1.4.0.tar.gz" -o libwebp.tar.gz && \ tar -xzvf libwebp.tar.gz && \ @@ -36,7 +38,7 @@ RUN cd ~ && \ RUN cd ~ && \ curl -L "https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.1.tar.gz" -o ffmpeg.tar.gz && \ tar -xzvf ffmpeg.tar.gz && \ - cd FFmpeg-n7.1 && \ + cd FFmpeg-n7.1 && patch libavutil/imgutils.c ~/patch/ffmpeg/imgutils.patch && \ PKG_CONFIG_PATH=/clib/lib/pkgconfig ./configure --enable-pic --prefix=/clib --enable-shared --disable-static \ --enable-gpl --enable-version3 --disable-doc --disable-ffplay \ --disable-network --disable-autodetect --enable-zlib \ diff --git a/patch/ffmpeg/imgutils.patch b/patch/ffmpeg/imgutils.patch new file mode 100644 index 0000000..21e7a63 --- /dev/null +++ b/patch/ffmpeg/imgutils.patch @@ -0,0 +1,11 @@ +--- imgutils.ori.c 2024-10-24 18:59:25.612400714 +0800 ++++ imgutils.c 2024-10-24 19:01:00.905336596 +0800 +@@ -298,7 +298,7 @@ + stride = 8LL*w; + stride += 128*8; + +- if (w==0 || h==0 || w > INT32_MAX || h > INT32_MAX || stride >= INT_MAX || stride*(h + 128ULL) >= INT_MAX) { ++ if (w==0 || h==0 || w > INT32_MAX || h > INT32_MAX || stride >= INT_MAX || stride*(h + 128ULL) >= INT64_MAX) { + av_log(&imgutils, AV_LOG_ERROR, "Picture size %ux%u is invalid\n", w, h); + return AVERROR(EINVAL); + }