patch ffmpeg

This commit is contained in:
2024-10-24 19:28:22 +08:00
parent cc5f412ac8
commit c9f1dab468
3 changed files with 15 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ on:
- docker_entrypoint.sh - docker_entrypoint.sh
- docker-compose.yml - docker-compose.yml
- '**.md' - '**.md'
- patch/
permissions: permissions:
contents: read contents: read

View File

@@ -24,6 +24,8 @@ RUN apt-get update && apt-get install -y \
&& apt-get clean \ && apt-get clean \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
COPY ./patch ~/patch
RUN cd ~ && \ RUN cd ~ && \
curl -L "https://github.com/webmproject/libwebp/archive/refs/tags/v1.4.0.tar.gz" -o libwebp.tar.gz && \ curl -L "https://github.com/webmproject/libwebp/archive/refs/tags/v1.4.0.tar.gz" -o libwebp.tar.gz && \
tar -xzvf libwebp.tar.gz && \ tar -xzvf libwebp.tar.gz && \
@@ -36,7 +38,7 @@ RUN cd ~ && \
RUN cd ~ && \ RUN cd ~ && \
curl -L "https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.1.tar.gz" -o ffmpeg.tar.gz && \ curl -L "https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.1.tar.gz" -o ffmpeg.tar.gz && \
tar -xzvf 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 \ PKG_CONFIG_PATH=/clib/lib/pkgconfig ./configure --enable-pic --prefix=/clib --enable-shared --disable-static \
--enable-gpl --enable-version3 --disable-doc --disable-ffplay \ --enable-gpl --enable-version3 --disable-doc --disable-ffplay \
--disable-network --disable-autodetect --enable-zlib \ --disable-network --disable-autodetect --enable-zlib \

View File

@@ -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);
}