[vlc-devel] [PATCH 3.0] contrib: ffmpeg: update to FFmpeg 3.4.8

Steve Lhomme robux4 at ycbcr.xyz
Wed Jun 2 06:57:29 UTC 2021


It should fix a lot of potential security issues.

- armv4 fixes have probably been merged, the code is not matching anymore
- mkv overshoot has been fixed upstreamed slightly differently
- the mpeg2 slice original patch has AV_PICTURE_TYPE_B checks
- the MOV trun memset issue has been fixed upstream
- other patches have been applied on top of the 3.4.8 tag
---
 ...p-Add-commas-between-macro-arguments.patch | 34 +++++-----
 ...set-the-SEI-parameters-early-on-the-.patch | 16 ++---
 ...c-don-t-call-hw-end_frame-when-start.patch |  6 +-
 ...profile-2-10-bit-DXVA2-D3D11-decodin.patch | 34 +++++-----
 ...st_data-instead-of-.section-.rodata-.patch |  8 +--
 ...c-don-t-end-a-slice-without-first_sl.patch | 14 ++--
 ...-compile-the-rgb2yuv-asm-if-.dn-alia.patch | 35 +++++-----
 ...Avoid-using-macro-expansion-counters.patch |  6 +-
 ...p-Add-commas-between-macro-arguments.patch |  8 +--
 ...t-size-on-ctts_data-in-mov_read_trun.patch | 68 -------------------
 contrib/src/ffmpeg/armv7_fixup.patch          | 14 ----
 contrib/src/ffmpeg/dxva_vc1_crash.patch       | 30 ++++++--
 contrib/src/ffmpeg/ffmpeg-mkv-overshoot.patch | 21 ------
 contrib/src/ffmpeg/h264_early_SAR.patch       |  8 +--
 contrib/src/ffmpeg/rules.mak                  |  9 ++-
 15 files changed, 112 insertions(+), 199 deletions(-)
 delete mode 100644 contrib/src/ffmpeg/0006-ffmpeg-Fix-memset-size-on-ctts_data-in-mov_read_trun.patch
 delete mode 100644 contrib/src/ffmpeg/armv7_fixup.patch
 delete mode 100644 contrib/src/ffmpeg/ffmpeg-mkv-overshoot.patch

diff --git a/contrib/src/ffmpeg/0001-arm-vc1dsp-Add-commas-between-macro-arguments.patch b/contrib/src/ffmpeg/0001-arm-vc1dsp-Add-commas-between-macro-arguments.patch
index b0ded07eb6..11152931a7 100644
--- a/contrib/src/ffmpeg/0001-arm-vc1dsp-Add-commas-between-macro-arguments.patch
+++ b/contrib/src/ffmpeg/0001-arm-vc1dsp-Add-commas-between-macro-arguments.patch
@@ -1,4 +1,4 @@
-From 1d5226a915ed98fcc3e0c1edd22908743f5a356e Mon Sep 17 00:00:00 2001
+From 77adf0c66e042bc3c4f9a92a3f773e3449a6cd18 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
 Date: Fri, 30 Mar 2018 12:31:09 +0300
 Subject: [PATCH 1/5] arm: vc1dsp: Add commas between macro arguments
@@ -14,11 +14,11 @@ require using gas-preprocessor any longer.
 
 Signed-off-by: Martin Storsjö <martin at martin.st>
 ---
- libavcodec/arm/vc1dsp_neon.S | 94 ++++++++++++++++++++++----------------------
+ libavcodec/arm/vc1dsp_neon.S | 94 ++++++++++++++++++------------------
  1 file changed, 47 insertions(+), 47 deletions(-)
 
 diff --git a/libavcodec/arm/vc1dsp_neon.S b/libavcodec/arm/vc1dsp_neon.S
-index de4d589..93f043b 100644
+index 611cbf2234..dbff0dd391 100644
 --- a/libavcodec/arm/vc1dsp_neon.S
 +++ b/libavcodec/arm/vc1dsp_neon.S
 @@ -410,13 +410,13 @@ function ff_vc1_inv_trans_8x8_neon, export=1
@@ -121,8 +121,8 @@ index de4d589..93f043b 100644
  
          @ At this point:
          @   line[0] = d0
-@@ -665,26 +665,26 @@ endfunc
- 
+@@ -666,26 +666,26 @@ endfunc
+ #if HAVE_AS_DN_DIRECTIVE
  @ The absolute value of multiplication constants from vc1_mspel_filter and vc1_mspel_{ver,hor}_filter_16bits.
  @ The sign is embedded in the code below that carries out the multiplication (mspel_filter{,.16}).
 -#define MSPEL_MODE_1_MUL_CONSTANTS  4 53 18 3
@@ -160,7 +160,7 @@ index de4d589..93f043b 100644
  
  @ Setup constants in registers for a subsequent use of mspel_filter{,.16}.
  .macro mspel_constants typesize reg_a reg_b reg_c reg_d filter_a filter_b filter_c filter_d reg_add filter_add_register
-@@ -818,7 +818,7 @@ T       mov             sp,  r4
+@@ -828,7 +828,7 @@ T       mov             sp,  r4
          sub             r1,  r1,  r2            @ r1 = &src[-stride]      @ slide back
  
          @ Do vertical filtering from src into tmp
@@ -169,7 +169,7 @@ index de4d589..93f043b 100644
  
          vld1.64         {d0,d1}, [r1], r2
          vld1.64         {d2,d3}, [r1], r2
-@@ -828,23 +828,23 @@ T       mov             sp,  r4
+@@ -838,23 +838,23 @@ T       mov             sp,  r4
          subs            r12,  r12,  #4
  
          vld1.64         {d6,d7}, [r1], r2
@@ -201,7 +201,7 @@ index de4d589..93f043b 100644
          vst1.64         {q11,q12}, [r4,:128]!   @ store and increment
  
          bne             1b
-@@ -854,7 +854,7 @@ T       mov             sp,  r4
+@@ -864,7 +864,7 @@ T       mov             sp,  r4
          mov             r4,   sp                @ r4 = tmp
  
          @ Do horizontal filtering from temp to dst
@@ -210,7 +210,7 @@ index de4d589..93f043b 100644
  
  2:
          subs            r12,  r12,  #1
-@@ -864,7 +864,7 @@ T       mov             sp,  r4
+@@ -874,7 +874,7 @@ T       mov             sp,  r4
          vext.16         q3,   q0,   q1,  #3
          vext.16         q1,   q0,   q1,  #1     @ do last because it writes to q1 which is read by the other vext instructions
  
@@ -219,7 +219,7 @@ index de4d589..93f043b 100644
  
          vst1.64         {d21}, [r0,:64], r2     @ store and increment dst
  
-@@ -877,9 +877,9 @@ endfunc
+@@ -887,9 +887,9 @@ endfunc
  
  @ Use C preprocessor and assembler macros to expand to functions for horizontal and vertical filtering.
  #define PUT_VC1_MSPEL_MC_HV(hmode, vmode)   \
@@ -232,7 +232,7 @@ index de4d589..93f043b 100644
          MSPEL_MODES_ ## hmode ## vmode ## _ADDSHIFT_CONSTANTS
  
  PUT_VC1_MSPEL_MC_HV(1, 1)
-@@ -900,7 +900,7 @@ function ff_put_vc1_mspel_mc\hmode\()0_neon, export=1
+@@ -910,7 +910,7 @@ function ff_put_vc1_mspel_mc\hmode\()0_neon, export=1
          mov             r12,  #8                        @ loop counter
          sub             r1,   r1,   #1                  @ slide back, using immediate
  
@@ -241,7 +241,7 @@ index de4d589..93f043b 100644
  
  1:
          subs            r12,  r12,  #1
-@@ -910,7 +910,7 @@ function ff_put_vc1_mspel_mc\hmode\()0_neon, export=1
+@@ -920,7 +920,7 @@ function ff_put_vc1_mspel_mc\hmode\()0_neon, export=1
          vext.8          d3,   d0,   d1,  #3
          vext.8          d1,   d0,   d1,  #1             @ do last because it writes to d1 which is read by the other vext instructions
  
@@ -250,7 +250,7 @@ index de4d589..93f043b 100644
  
          vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
  
-@@ -922,7 +922,7 @@ endfunc
+@@ -932,7 +932,7 @@ endfunc
  
  @ Use C preprocessor and assembler macros to expand to functions for horizontal only filtering.
  #define PUT_VC1_MSPEL_MC_H_ONLY(hmode) \
@@ -259,7 +259,7 @@ index de4d589..93f043b 100644
  
  PUT_VC1_MSPEL_MC_H_ONLY(1)
  PUT_VC1_MSPEL_MC_H_ONLY(2)
-@@ -937,7 +937,7 @@ function ff_put_vc1_mspel_mc0\vmode\()_neon, export=1
+@@ -947,7 +947,7 @@ function ff_put_vc1_mspel_mc0\vmode\()_neon, export=1
          mov             r12,  #8                        @ loop counter
          sub             r1,   r1,   r2                  @ r1 = &src[-stride]      @ slide back
  
@@ -268,7 +268,7 @@ index de4d589..93f043b 100644
  
          vld1.64         {d0},  [r1], r2                 @ d0 = src[-stride]
          vld1.64         {d1},  [r1], r2                 @ d1 = src[0]
-@@ -947,19 +947,19 @@ function ff_put_vc1_mspel_mc0\vmode\()_neon, export=1
+@@ -957,19 +957,19 @@ function ff_put_vc1_mspel_mc0\vmode\()_neon, export=1
          subs            r12,  r12,  #4
  
          vld1.64         {d3},  [r1], r2                 @ d3 = src[stride * 2]
@@ -292,7 +292,7 @@ index de4d589..93f043b 100644
          vst1.64         {d21}, [r0,:64], r2             @ store and increment dst
  
          bne             1b
-@@ -970,7 +970,7 @@ endfunc
+@@ -980,7 +980,7 @@ endfunc
  
  @ Use C preprocessor and assembler macros to expand to functions for vertical only filtering.
  #define PUT_VC1_MSPEL_MC_V_ONLY(vmode) \
@@ -302,5 +302,5 @@ index de4d589..93f043b 100644
  PUT_VC1_MSPEL_MC_V_ONLY(1)
  PUT_VC1_MSPEL_MC_V_ONLY(2)
 -- 
-2.7.4
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0001-avcodec-hevcdec-set-the-SEI-parameters-early-on-the-.patch b/contrib/src/ffmpeg/0001-avcodec-hevcdec-set-the-SEI-parameters-early-on-the-.patch
index 134200868c..7f64364b03 100644
--- a/contrib/src/ffmpeg/0001-avcodec-hevcdec-set-the-SEI-parameters-early-on-the-.patch
+++ b/contrib/src/ffmpeg/0001-avcodec-hevcdec-set-the-SEI-parameters-early-on-the-.patch
@@ -1,4 +1,4 @@
-From 66fac4911abbc52333bc35dcff0cab7fa6f0171d Mon Sep 17 00:00:00 2001
+From ac024a8eb5ea1a41951c1678c1a3a15dd20d88cb Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 24 May 2019 08:58:00 +0200
 Subject: [PATCH] avcodec/hevcdec: set the SEI parameters early on the
@@ -14,10 +14,10 @@ Co-authored-by: James Almer <jamrial at gmail.com>
  1 file changed, 11 insertions(+), 10 deletions(-)
 
 diff --git a/libavcodec/hevcdec.c b/libavcodec/hevcdec.c
-index 515b346535..f1934975d5 100644
+index e9651855e2..775f017189 100644
 --- a/libavcodec/hevcdec.c
 +++ b/libavcodec/hevcdec.c
-@@ -310,9 +310,10 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
+@@ -313,9 +313,10 @@ static int decode_lt_rps(HEVCContext *s, LongTermRPS *rps, GetBitContext *gb)
      return 0;
  }
  
@@ -30,7 +30,7 @@ index 515b346535..f1934975d5 100644
      const HEVCVPS *vps = (const HEVCVPS*)ps->vps_list[sps->vps_id]->data;
      const HEVCWindow *ow = &sps->output_window;
      unsigned int num = 0, den = 0;
-@@ -355,6 +356,12 @@ static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
+@@ -358,6 +359,12 @@ static void export_stream_params(AVCodecContext *avctx, const HEVCParamSets *ps,
      if (num != 0 && den != 0)
          av_reduce(&avctx->framerate.den, &avctx->framerate.num,
                    num, den, 1 << 30);
@@ -43,7 +43,7 @@ index 515b346535..f1934975d5 100644
  }
  
  static enum AVPixelFormat get_format(HEVCContext *s, const HEVCSPS *sps)
-@@ -447,7 +454,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps,
+@@ -428,7 +435,7 @@ static int set_sps(HEVCContext *s, const HEVCSPS *sps,
      if (ret < 0)
          goto fail;
  
@@ -52,7 +52,7 @@ index 515b346535..f1934975d5 100644
  
      s->avctx->pix_fmt = pix_fmt;
  
-@@ -2778,12 +2785,6 @@ static int set_side_data(HEVCContext *s)
+@@ -2751,12 +2758,6 @@ static int set_side_data(HEVCContext *s)
          s->avctx->properties |= FF_CODEC_PROPERTY_CLOSED_CAPTIONS;
      }
  
@@ -65,7 +65,7 @@ index 515b346535..f1934975d5 100644
      return 0;
  }
  
-@@ -3179,7 +3180,7 @@ static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length, int f
+@@ -3102,7 +3103,7 @@ static int hevc_decode_extradata(HEVCContext *s, uint8_t *buf, int length, int f
      for (i = 0; i < FF_ARRAY_ELEMS(s->ps.sps_list); i++) {
          if (first && s->ps.sps_list[i]) {
              const HEVCSPS *sps = (const HEVCSPS*)s->ps.sps_list[i]->data;
@@ -75,5 +75,5 @@ index 515b346535..f1934975d5 100644
          }
      }
 -- 
-2.19.1.windows.1
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch b/contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
index 138ddd83e4..4cd585cfa3 100644
--- a/contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
+++ b/contrib/src/ffmpeg/0001-avcodec-mpeg12dec-don-t-call-hw-end_frame-when-start.patch
@@ -1,4 +1,4 @@
-From 3ca2f6e24f4422f789e6483bb782052f7f91e4e4 Mon Sep 17 00:00:00 2001
+From 3fbae30610400962221876878b926476e0184d7e Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 12 Feb 2021 08:20:56 +0100
 Subject: [PATCH 1/2] avcodec/mpeg12dec: don't call hw->end_frame when starting
@@ -12,10 +12,10 @@ expected after this patch.
  1 file changed, 9 deletions(-)
 
 diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
-index ac5ac4bca4..88d10e9236 100644
+index c6a56fd5ae..64d03f43c7 100644
 --- a/libavcodec/mpeg12dec.c
 +++ b/libavcodec/mpeg12dec.c
-@@ -1674,15 +1674,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
+@@ -1686,15 +1686,6 @@ static int mpeg_field_start(MpegEncContext *s, const uint8_t *buf, int buf_size)
              return AVERROR_INVALIDDATA;
          }
  
diff --git a/contrib/src/ffmpeg/0001-avcodec-vp9-add-profile-2-10-bit-DXVA2-D3D11-decodin.patch b/contrib/src/ffmpeg/0001-avcodec-vp9-add-profile-2-10-bit-DXVA2-D3D11-decodin.patch
index d2593d0f88..bfbf53df69 100644
--- a/contrib/src/ffmpeg/0001-avcodec-vp9-add-profile-2-10-bit-DXVA2-D3D11-decodin.patch
+++ b/contrib/src/ffmpeg/0001-avcodec-vp9-add-profile-2-10-bit-DXVA2-D3D11-decodin.patch
@@ -1,4 +1,4 @@
-From 7e20c8f5ebe96de94694be10e24b791e1ed4ea2d Mon Sep 17 00:00:00 2001
+From 63965f1001310c9670bb8173d4fbebeee7070b59 Mon Sep 17 00:00:00 2001
 From: Hendrik Leppkes <h.leppkes at gmail.com>
 Date: Mon, 29 May 2017 12:09:47 +0200
 Subject: [PATCH] avcodec/vp9: add profile 2 10-bit DXVA2/D3D11 decoding
@@ -6,29 +6,27 @@ Subject: [PATCH] avcodec/vp9: add profile 2 10-bit DXVA2/D3D11 decoding
 
 Fixes trac ticket #7099.
 ---
- libavcodec/vp9.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ libavcodec/vp9.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
 
 diff --git a/libavcodec/vp9.c b/libavcodec/vp9.c
-index 0fac638ec9..b1178c9c0c 100644
+index f2cf194243..0017b1abb5 100644
 --- a/libavcodec/vp9.c
 +++ b/libavcodec/vp9.c
-@@ -188,6 +188,7 @@ static int update_size(AVCodecContext *avctx, int w, int h)
- 
-         switch (s->pix_fmt) {
-         case AV_PIX_FMT_YUV420P:
-+        case AV_PIX_FMT_YUV420P10:
- #if CONFIG_VP9_DXVA2_HWACCEL
-             *fmtp++ = AV_PIX_FMT_DXVA2_VLD;
- #endif
-@@ -202,7 +203,6 @@ static int update_size(AVCodecContext *avctx, int w, int h)
+@@ -199,6 +199,13 @@ static int update_size(AVCodecContext *avctx, int w, int h)
+         case AV_PIX_FMT_YUV420P12:
+ #if CONFIG_VP9_VAAPI_HWACCEL
              *fmtp++ = AV_PIX_FMT_VAAPI;
++#endif
++#if CONFIG_VP9_DXVA2_HWACCEL
++            *fmtp++ = AV_PIX_FMT_DXVA2_VLD;
++#endif
++#if CONFIG_VP9_D3D11VA_HWACCEL
++            *fmtp++ = AV_PIX_FMT_D3D11VA_VLD;
++            *fmtp++ = AV_PIX_FMT_D3D11;
  #endif
              break;
--        case AV_PIX_FMT_YUV420P10:
-         case AV_PIX_FMT_YUV420P12:
- #if CONFIG_VP9_NVDEC_HWACCEL
-             *fmtp++ = AV_PIX_FMT_CUDA;
+         }
 -- 
-2.26.0.windows.1
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0002-arm-Produce-.const_data-instead-of-.section-.rodata-.patch b/contrib/src/ffmpeg/0002-arm-Produce-.const_data-instead-of-.section-.rodata-.patch
index d9e26923f0..fe8215dab4 100644
--- a/contrib/src/ffmpeg/0002-arm-Produce-.const_data-instead-of-.section-.rodata-.patch
+++ b/contrib/src/ffmpeg/0002-arm-Produce-.const_data-instead-of-.section-.rodata-.patch
@@ -1,4 +1,4 @@
-From bb88d98dd80ab5bb1d41ddf635ce293d5679726b Mon Sep 17 00:00:00 2001
+From 7a47e4bad9a6c92370b04cdcaa4a00fb2b365773 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
 Date: Fri, 30 Mar 2018 12:33:46 +0300
 Subject: [PATCH 2/5] arm: Produce .const_data instead of .section .rodata for
@@ -19,10 +19,10 @@ Signed-off-by: Martin Storsjö <martin at martin.st>
  1 file changed, 7 insertions(+), 1 deletion(-)
 
 diff --git a/libavutil/arm/asm.S b/libavutil/arm/asm.S
-index eb689a1..6744f2a 100644
+index 7d33a64fac..9d8d36fe2c 100644
 --- a/libavutil/arm/asm.S
 +++ b/libavutil/arm/asm.S
-@@ -111,11 +111,17 @@ FUNC    .func   \name
+@@ -109,11 +109,17 @@ FUNC    .func   \name
  ELF     .size   \name, . - \name
          .purgem endconst
      .endm
@@ -42,5 +42,5 @@ index eb689a1..6744f2a 100644
  \name:
  .endm
 -- 
-2.7.4
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch b/contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
index 212343d251..caa43b71df 100644
--- a/contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
+++ b/contrib/src/ffmpeg/0002-avcodec-mpeg12dec-don-t-end-a-slice-without-first_sl.patch
@@ -1,4 +1,4 @@
-From 3eb70589260b6eb0e37265933a15c737023dfd7e Mon Sep 17 00:00:00 2001
+From 4a921c94e7c6c6b15c37cea67da3575b466278e1 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 12 Feb 2021 11:10:03 +0100
 Subject: [PATCH 2/2] avcodec/mpeg12dec: don't end a slice without first_slice
@@ -14,19 +14,19 @@ for this check to work.
  1 file changed, 13 insertions(+), 7 deletions(-)
 
 diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
-index 88d10e9236..fdf210fa1b 100644
+index 64d03f43c7..a017f6386c 100644
 --- a/libavcodec/mpeg12dec.c
 +++ b/libavcodec/mpeg12dec.c
-@@ -2477,13 +2477,19 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
-                         s2->er.error_count += s2->thread_context[i]->er.error_count;
-                 }
+@@ -2456,13 +2456,19 @@ static int decode_chunks(AVCodecContext *avctx, AVFrame *picture,
+                     ff_vdpau_mpeg_picture_complete(s2, buf, buf_size, s->slice_count);
+ #endif
  
 -                ret = slice_end(avctx, picture);
 -                if (ret < 0)
 -                    return ret;
 -                else if (ret) {
 -                    // FIXME: merge with the stuff in mpeg_decode_slice
--                    if (s2->last_picture_ptr || s2->low_delay)
+-                    if (s2->last_picture_ptr || s2->low_delay || s2->pict_type == AV_PICTURE_TYPE_B)
 -                        *got_output = 1;
 +                if (s->first_slice) // not started yet. don't end it
 +                    ret = 0;
@@ -36,7 +36,7 @@ index 88d10e9236..fdf210fa1b 100644
 +                        return ret;
 +                    else if (ret) {
 +                        // FIXME: merge with the stuff in mpeg_decode_slice
-+                        if (s2->last_picture_ptr || s2->low_delay)
++                        if (s2->last_picture_ptr || s2->low_delay || s2->pict_type == AV_PICTURE_TYPE_B)
 +                            *got_output = 1;
 +                    }
 +                    // slice ended, don't end it again later
diff --git a/contrib/src/ffmpeg/0003-arm-swscale-Only-compile-the-rgb2yuv-asm-if-.dn-alia.patch b/contrib/src/ffmpeg/0003-arm-swscale-Only-compile-the-rgb2yuv-asm-if-.dn-alia.patch
index d726fc3f65..245e463449 100644
--- a/contrib/src/ffmpeg/0003-arm-swscale-Only-compile-the-rgb2yuv-asm-if-.dn-alia.patch
+++ b/contrib/src/ffmpeg/0003-arm-swscale-Only-compile-the-rgb2yuv-asm-if-.dn-alia.patch
@@ -1,4 +1,4 @@
-From b4ad8b2a18be134c2963371f4da1d80aff8ab433 Mon Sep 17 00:00:00 2001
+From 77bd93bff48f27df6c841d7cfefa1eca4ce637aa Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
 Date: Sat, 31 Mar 2018 21:54:32 +0300
 Subject: [PATCH 3/5] arm: swscale: Only compile the rgb2yuv asm if .dn aliases
@@ -20,37 +20,38 @@ Alternatively, the assembly could be rewritten to not use the
 
 Signed-off-by: Martin Storsjö <martin at martin.st>
 ---
- configure                         | 5 +++++
+ configure                         | 6 ++++++
  libswscale/arm/rgb2yuv_neon_16.S  | 3 +++
  libswscale/arm/rgb2yuv_neon_32.S  | 3 +++
  libswscale/arm/swscale_unscaled.c | 6 ++++++
- 4 files changed, 17 insertions(+)
+ 4 files changed, 18 insertions(+)
 
 diff --git a/configure b/configure
-index d5bbb5b..20c5565 100755
+index 8de1146602..50b023c70a 100755
 --- a/configure
 +++ b/configure
-@@ -2063,6 +2063,7 @@ SYSTEM_LIBRARIES="
+@@ -2054,6 +2054,8 @@ SYSTEM_FUNCS="
+ "
  
  TOOLCHAIN_FEATURES="
-     as_arch_directive
 +    as_dn_directive
++    as_dn_directive
+     as_dn_directive
      as_fpu_directive
      as_func
-     as_object_arch
-@@ -5397,6 +5398,10 @@ EOF
-     check_as <<EOF && enable as_arch_directive
- .arch armv7-a
- EOF
+@@ -5480,6 +5482,10 @@ EOF
+     check_as <<EOF && enable as_dn_directive
+ ra .dn d0.i16
+ .unreq ra
++EOF
 +    check_as <<EOF && enable as_dn_directive
 +ra .dn d0.i16
 +.unreq ra
-+EOF
+ EOF
      check_as <<EOF && enable as_fpu_directive
  .fpu neon
- EOF
 diff --git a/libswscale/arm/rgb2yuv_neon_16.S b/libswscale/arm/rgb2yuv_neon_16.S
-index 601bc9a..ad7e679 100644
+index 601bc9a9b7..ad7e679ca9 100644
 --- a/libswscale/arm/rgb2yuv_neon_16.S
 +++ b/libswscale/arm/rgb2yuv_neon_16.S
 @@ -18,6 +18,8 @@
@@ -68,7 +69,7 @@ index 601bc9a..ad7e679 100644
      loop_420sp  rgbx, nv12, init, kernel_420_16x2, 16
 +#endif
 diff --git a/libswscale/arm/rgb2yuv_neon_32.S b/libswscale/arm/rgb2yuv_neon_32.S
-index f51a5f1..4fd0f64 100644
+index f51a5f149f..4fd0f64a09 100644
 --- a/libswscale/arm/rgb2yuv_neon_32.S
 +++ b/libswscale/arm/rgb2yuv_neon_32.S
 @@ -18,6 +18,8 @@
@@ -86,7 +87,7 @@ index f51a5f1..4fd0f64 100644
      loop_420sp  rgbx, nv12, init, kernel_420_16x2, 32
 +#endif
 diff --git a/libswscale/arm/swscale_unscaled.c b/libswscale/arm/swscale_unscaled.c
-index e1597ab..e41f294 100644
+index e1597ab42d..e41f294eac 100644
 --- a/libswscale/arm/swscale_unscaled.c
 +++ b/libswscale/arm/swscale_unscaled.c
 @@ -23,6 +23,7 @@
@@ -107,5 +108,5 @@ index e1597ab..e41f294 100644
 +}
 +#endif
 -- 
-2.7.4
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0004-arm-hevcdsp-Avoid-using-macro-expansion-counters.patch b/contrib/src/ffmpeg/0004-arm-hevcdsp-Avoid-using-macro-expansion-counters.patch
index d8eed9f670..3db6ad0c27 100644
--- a/contrib/src/ffmpeg/0004-arm-hevcdsp-Avoid-using-macro-expansion-counters.patch
+++ b/contrib/src/ffmpeg/0004-arm-hevcdsp-Avoid-using-macro-expansion-counters.patch
@@ -1,4 +1,4 @@
-From abb4a27ace289212626a20b200a42aa90bf4de8f Mon Sep 17 00:00:00 2001
+From 7db247e18b3221e7908d3804566ca534b0c4a9a9 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
 Date: Sat, 31 Mar 2018 21:54:41 +0300
 Subject: [PATCH 4/5] arm: hevcdsp: Avoid using macro expansion counters
@@ -21,7 +21,7 @@ Signed-off-by: Martin Storsjö <martin at martin.st>
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/libavcodec/arm/hevcdsp_deblock_neon.S b/libavcodec/arm/hevcdsp_deblock_neon.S
-index 166bddb..7cb7487 100644
+index 166bddb104..7cb7487ef6 100644
 --- a/libavcodec/arm/hevcdsp_deblock_neon.S
 +++ b/libavcodec/arm/hevcdsp_deblock_neon.S
 @@ -152,7 +152,7 @@
@@ -57,5 +57,5 @@ index 166bddb..7cb7487 100644
          vqmovun.s16 d18, q9
          vqmovun.s16 d20, q10
 -- 
-2.7.4
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0005-arm-hevcdsp-Add-commas-between-macro-arguments.patch b/contrib/src/ffmpeg/0005-arm-hevcdsp-Add-commas-between-macro-arguments.patch
index c7133af3be..3f28c93cf6 100644
--- a/contrib/src/ffmpeg/0005-arm-hevcdsp-Add-commas-between-macro-arguments.patch
+++ b/contrib/src/ffmpeg/0005-arm-hevcdsp-Add-commas-between-macro-arguments.patch
@@ -1,4 +1,4 @@
-From ecd4c9276b8407b912551ddb74b376cbcbe02e30 Mon Sep 17 00:00:00 2001
+From 0cd64029dd78a4de05ce9f185b1d72ecfd8b0dc8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Martin=20Storsj=C3=B6?= <martin at martin.st>
 Date: Sat, 31 Mar 2018 21:54:46 +0300
 Subject: [PATCH 5/5] arm: hevcdsp: Add commas between macro arguments
@@ -14,11 +14,11 @@ require using gas-preprocessor any longer.
 
 Signed-off-by: Martin Storsjö <martin at martin.st>
 ---
- libavcodec/arm/hevcdsp_qpel_neon.S | 36 ++++++++++++++++++------------------
+ libavcodec/arm/hevcdsp_qpel_neon.S | 36 +++++++++++++++---------------
  1 file changed, 18 insertions(+), 18 deletions(-)
 
 diff --git a/libavcodec/arm/hevcdsp_qpel_neon.S b/libavcodec/arm/hevcdsp_qpel_neon.S
-index 86f92cf..caa6efa 100644
+index 86f92cf75a..caa6efa766 100644
 --- a/libavcodec/arm/hevcdsp_qpel_neon.S
 +++ b/libavcodec/arm/hevcdsp_qpel_neon.S
 @@ -667,76 +667,76 @@ endfunc
@@ -117,5 +117,5 @@ index 86f92cf..caa6efa 100644
  
  .macro init_put_pixels
 -- 
-2.7.4
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/0006-ffmpeg-Fix-memset-size-on-ctts_data-in-mov_read_trun.patch b/contrib/src/ffmpeg/0006-ffmpeg-Fix-memset-size-on-ctts_data-in-mov_read_trun.patch
deleted file mode 100644
index caad5954c2..0000000000
--- a/contrib/src/ffmpeg/0006-ffmpeg-Fix-memset-size-on-ctts_data-in-mov_read_trun.patch
+++ /dev/null
@@ -1,68 +0,0 @@
-From f5f2209d689cd17f4bce7ce5c4f0b1634befc785 Mon Sep 17 00:00:00 2001
-From: Xiaohan Wang <xhwang at chromium.org>
-Date: Fri, 23 Feb 2018 17:04:41 -0800
-Subject: [PATCH] ffmpeg: Fix memset size on ctts_data in mov_read_trun()
- (round 2)
-
-The allocated size of sc->ctts_data is
-(st->nb_index_entries + entries) * sizeof(*sc->ctts_data).
-
-The size to memset at offset sc->ctts_data + sc->ctts_count should be
-(st->nb_index_entries + entries - sc->ctts_count) *
-sizeof(*sc->ctts_data))
-
-The current code missed |entries| I believe, which was introduced in
-https://patchwork.ffmpeg.org/patch/5541/.
-
-However, after offline discussion, it seems the original code is much
-more clear to read (before https://patchwork.ffmpeg.org/patch/5541/).
-
-Hence this CL revert the memset logic to it's previous state by
-remembering the |old_ctts_allocated_size|, and only memset the newly
-allocated entries.
-
-BUG=812567
-
-Change-Id: Ibe94c7138e5818bfaae76866bfa6619a9b8a2b6b
-Reviewed-on: https://chromium-review.googlesource.com/934925
-Reviewed-by: Dale Curtis <dalecurtis at chromium.org>
-
-Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
----
- libavformat/mov.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
-diff --git a/libavformat/mov.c b/libavformat/mov.c
-index 04567fc475..f01116874c 100644
---- a/libavformat/mov.c
-+++ b/libavformat/mov.c
-@@ -4596,6 +4596,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-     int64_t prev_dts = AV_NOPTS_VALUE;
-     int next_frag_index = -1, index_entry_pos;
-     size_t requested_size;
-+    size_t old_ctts_allocated_size;
-     AVIndexEntry *new_entries;
-     MOVFragmentStreamInfo * frag_stream_info;
- 
-@@ -4688,6 +4689,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-     st->index_entries= new_entries;
- 
-     requested_size = (st->nb_index_entries + entries) * sizeof(*sc->ctts_data);
-+    old_ctts_allocated_size = sc->ctts_allocated_size;
-     ctts_data = av_fast_realloc(sc->ctts_data, &sc->ctts_allocated_size,
-                                 requested_size);
-     if (!ctts_data)
-@@ -4697,8 +4699,8 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
-     // In case there were samples without ctts entries, ensure they get
-     // zero valued entries. This ensures clips which mix boxes with and
-     // without ctts entries don't pickup uninitialized data.
--    memset(sc->ctts_data + sc->ctts_count, 0,
--           (st->nb_index_entries - sc->ctts_count) * sizeof(*sc->ctts_data));
-+    memset((uint8_t*)(sc->ctts_data) + old_ctts_allocated_size, 0,
-+           sc->ctts_allocated_size - old_ctts_allocated_size);
- 
-     if (index_entry_pos < st->nb_index_entries) {
-         // Make hole in index_entries and ctts_data for new samples
--- 
-2.20.1
-
diff --git a/contrib/src/ffmpeg/armv7_fixup.patch b/contrib/src/ffmpeg/armv7_fixup.patch
deleted file mode 100644
index 0fe40de595..0000000000
--- a/contrib/src/ffmpeg/armv7_fixup.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff --git a/libavcodec/arm/hevcdsp_idct_neon.S b/libavcodec/arm/hevcdsp_idct_neon.S
-index 139029a256..5ac730c075 100644
---- a/libavcodec/arm/hevcdsp_idct_neon.S
-+++ b/libavcodec/arm/hevcdsp_idct_neon.S
-@@ -1017,8 +1017,8 @@ endfunc
- tr_16x4 firstpass, 7, 512, 1
- tr_16x4 secondpass_8, 20 - 8, 512, 1
- tr_16x4 secondpass_10, 20 - 10, 512, 1
--tr_16x4 noscale, 0, 2048, 4
- .ltorg
-+tr_16x4 noscale, 0, 2048, 4
- tr_32x4 firstpass, 7
- tr_32x4 secondpass_8, 20 - 8
- tr_32x4 secondpass_10, 20 - 10
diff --git a/contrib/src/ffmpeg/dxva_vc1_crash.patch b/contrib/src/ffmpeg/dxva_vc1_crash.patch
index 3e5c3ed683..e7e41d3e01 100644
--- a/contrib/src/ffmpeg/dxva_vc1_crash.patch
+++ b/contrib/src/ffmpeg/dxva_vc1_crash.patch
@@ -1,6 +1,19 @@
---- ffmpeg/libavcodec/dxva2_vc1.c	2017-12-19 14:46:36.070857200 +0100
-+++ ffmpeg/libavcodec/dxva2_vc1.c.refcrash	2017-12-19 14:36:57.157973200 +0100
-@@ -58,11 +58,11 @@ static void fill_picture_parameters(AVCo
+From 940be5c1f4c7b137d5916607098808085f8cbfeb Mon Sep 17 00:00:00 2001
+From: Steve Lhomme <robux4 at ycbcr.xyz>
+Date: Tue, 19 Dec 2017 14:51:26 +0100
+Subject: [PATCH] dxva: fix crash in DVXA in interlaced VC-1/MPEG2
+
+Ref #18916
+---
+ libavcodec/dxva2_mpeg2.c | 4 ++--
+ libavcodec/dxva2_vc1.c   | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/libavcodec/dxva2_mpeg2.c b/libavcodec/dxva2_mpeg2.c
+index b7c69378f0..21f96e901f 100644
+--- a/libavcodec/dxva2_vc1.c
++++ b/libavcodec/dxva2_vc1.c
+@@ -58,11 +58,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
      memset(pp, 0, sizeof(*pp));
      pp->wDecodedPictureIndex    =
      pp->wDeblockedPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
@@ -14,9 +27,9 @@
          pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
      else
          pp->wBackwardRefPictureIndex = 0xffff;
---- ffmpeg/libavcodec/dxva2_mpeg2.c	2018-01-23 12:58:14.672161600 +0100
-+++ ffmpeg/libavcodec/dxva2_mpeg2.c.ref	2018-01-23 12:56:45.439743300 +0100
-@@ -51,11 +51,11 @@ static void fill_picture_parameters(AVCo
+--- a/libavcodec/dxva2_mpeg2.c
++++ b/libavcodec/dxva2_mpeg2.c
+@@ -51,11 +51,11 @@ static void fill_picture_parameters(AVCodecContext *avctx,
      memset(pp, 0, sizeof(*pp));
      pp->wDecodedPictureIndex         = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
      pp->wDeblockedPictureIndex       = 0;
@@ -30,3 +43,8 @@
          pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
      else
          pp->wBackwardRefPictureIndex = 0xffff;
+diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
+index e5353cdddc..f4a2176714 100644
+--
+2.27.0.windows.1
+
diff --git a/contrib/src/ffmpeg/ffmpeg-mkv-overshoot.patch b/contrib/src/ffmpeg/ffmpeg-mkv-overshoot.patch
deleted file mode 100644
index 2ad31ca54a..0000000000
--- a/contrib/src/ffmpeg/ffmpeg-mkv-overshoot.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- ffmpeg/libavformat/matroskadec.c.overshoot	2019-02-11 16:03:57.375444600 +0100
-+++ ffmpeg/libavformat/matroskadec.c	2019-02-11 16:04:04.418307200 +0100
-@@ -1197,6 +1197,18 @@ static int ebml_parse_elem(MatroskaDemux
-                    length, max_lengths[syntax->type], syntax->type);
-             return AVERROR_INVALIDDATA;
-         }
-+        if (matroska->num_levels > 0) {
-+            MatroskaLevel *level = &matroska->levels[matroska->num_levels - 1];
-+            AVIOContext *pb = matroska->ctx->pb;
-+            int64_t pos = avio_tell(pb);
-+            if (level->length != (uint64_t) -1 &&
-+                (pos + length) > (level->start + level->length)) {
-+                av_log(matroska->ctx, AV_LOG_ERROR,
-+                       "Invalid length 0x%"PRIx64" > 0x%"PRIx64" in parent\n",
-+                       length, level->start + level->length);
-+                return AVERROR_INVALIDDATA;
-+            }
-+        }
-     }
- 
-     switch (syntax->type) {
diff --git a/contrib/src/ffmpeg/h264_early_SAR.patch b/contrib/src/ffmpeg/h264_early_SAR.patch
index 045eac42eb..80f7cfc1a1 100644
--- a/contrib/src/ffmpeg/h264_early_SAR.patch
+++ b/contrib/src/ffmpeg/h264_early_SAR.patch
@@ -1,4 +1,4 @@
-From 9ace07a594b55cb564b39d704835a191387ba277 Mon Sep 17 00:00:00 2001
+From d675990f0ed922c0a1278bb768b1b9cfbd5bec21 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Fri, 19 Jan 2018 12:55:52 +0100
 Subject: [PATCH] avcodec/h264_slice: use the new SAR early when setting the
@@ -13,10 +13,10 @@ See the sample mentioned here: https://trac.videolan.org/vlc/ticket/19435
  1 file changed, 3 insertions(+), 1 deletion(-)
 
 diff --git a/libavcodec/h264_slice.c b/libavcodec/h264_slice.c
-index e6b7998834..319a37f5b6 100644
+index c9c475d73c..3808009afe 100644
 --- a/libavcodec/h264_slice.c
 +++ b/libavcodec/h264_slice.c
-@@ -1050,8 +1050,10 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_sl
+@@ -1063,8 +1063,10 @@ static int h264_init_ps(H264Context *h, const H264SliceContext *sl, int first_sl
          || (non_j_pixfmt(h->avctx->pix_fmt) != non_j_pixfmt(get_pixel_format(h, 0))))
          must_reinit = 1;
  
@@ -29,5 +29,5 @@ index e6b7998834..319a37f5b6 100644
      if (!h->setup_finished) {
          h->avctx->profile = ff_h264_get_profile(sps);
 -- 
-2.14.2
+2.27.0.windows.1
 
diff --git a/contrib/src/ffmpeg/rules.mak b/contrib/src/ffmpeg/rules.mak
index 7966c653d6..c27ac74e1d 100644
--- a/contrib/src/ffmpeg/rules.mak
+++ b/contrib/src/ffmpeg/rules.mak
@@ -5,13 +5,15 @@
 #USE_FFMPEG ?= 1
 
 ifndef USE_LIBAV
-FFMPEG_HASH=eaff5fcb7cde8d1614755269773d471d3a3d1bfc
+FFMPEG_HASH=567c20f78109588620c57696ab39ff314fe12d6c
+FFMPEG_BRANCHES=release/3.4
 FFMPEG_SNAPURL := http://git.videolan.org/?p=ffmpeg.git;a=snapshot;h=$(FFMPEG_HASH);sf=tgz
 FFMPEG_GITURL := http://git.videolan.org/git/ffmpeg.git
 FFMPEG_LAVC_MIN := 57.37.100
 USE_FFMPEG := 1
 else
 FFMPEG_HASH=e171022c24c42b1e88a51bb3b4c27f13c87c85cb
+FFMPEG_BRANCHES=
 FFMPEG_SNAPURL := http://git.libav.org/?p=libav.git;a=snapshot;h=$(FFMPEG_HASH);sf=tgz
 FFMPEG_GITURL := git://git.libav.org/libav.git
 FFMPEG_LAVC_MIN := 57.16.0
@@ -221,7 +223,7 @@ endif
 FFMPEGCONF += --nm="$(NM)" --ar="$(AR)"
 
 $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz:
-	$(call download_git,$(FFMPEG_GITURL),,$(FFMPEG_HASH))
+	$(call download_git,$(FFMPEG_GITURL),$(FFMPEG_BRANCHES),$(FFMPEG_HASH))
 
 .sum-ffmpeg: $(TARBALLS)/ffmpeg-$(FFMPEG_BASENAME).tar.xz
 	$(call check_githash,$(FFMPEG_HASH))
@@ -237,11 +239,8 @@ ifdef USE_FFMPEG
 	$(APPLY) $(SRC)/ffmpeg/0003-arm-swscale-Only-compile-the-rgb2yuv-asm-if-.dn-alia.patch
 	$(APPLY) $(SRC)/ffmpeg/0004-arm-hevcdsp-Avoid-using-macro-expansion-counters.patch
 	$(APPLY) $(SRC)/ffmpeg/0005-arm-hevcdsp-Add-commas-between-macro-arguments.patch
-	$(APPLY) $(SRC)/ffmpeg/0006-ffmpeg-Fix-memset-size-on-ctts_data-in-mov_read_trun.patch
-	$(APPLY) $(SRC)/ffmpeg/armv7_fixup.patch
 	$(APPLY) $(SRC)/ffmpeg/dxva_vc1_crash.patch
 	$(APPLY) $(SRC)/ffmpeg/h264_early_SAR.patch
-	$(APPLY) $(SRC)/ffmpeg/ffmpeg-mkv-overshoot.patch
 	$(APPLY) $(SRC)/ffmpeg/0001-avcodec-hevcdec-set-the-SEI-parameters-early-on-the-.patch
 	$(APPLY) $(SRC)/ffmpeg/0001-avcodec-h264_slice-set-the-SEI-parameters-early-on-t.patch
 	$(APPLY) $(SRC)/ffmpeg/0001-avcodec-vp9-add-profile-2-10-bit-DXVA2-D3D11-decodin.patch
-- 
2.29.2



More information about the vlc-devel mailing list