Skip to content

Commit

Permalink
patch ffmpeg
Browse files Browse the repository at this point in the history
  • Loading branch information
lifegpc committed Oct 24, 2024
1 parent cc5f412 commit c9f1dab
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ on:
- docker_entrypoint.sh
- docker-compose.yml
- '**.md'
- patch/

permissions:
contents: read
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 && \
Expand All @@ -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 \
Expand Down
11 changes: 11 additions & 0 deletions patch/ffmpeg/imgutils.patch
Original file line number Diff line number Diff line change
@@ -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);
}

0 comments on commit c9f1dab

Please sign in to comment.