[vlc-commits] [Git][videolan/vlc][master] contrib: ffmpeg: fix DXVA MPEG2 output

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Fri Nov 15 07:31:25 UTC 2024



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
89615d0e by Steve Lhomme at 2024-11-15T06:53:58+00:00
contrib: ffmpeg: fix DXVA MPEG2 output

The updated patch doesn't meet the underlying libavcodec changes.
The VC-1 patch is not needed as the merged version upstream is sufficient.

The MPEG-2 patch is done in a similar way as the VC-1 patch.

Fixes #28855

- - - - -


1 changed file:

- contrib/src/ffmpeg/dxva_vc1_crash.patch


Changes:

=====================================
contrib/src/ffmpeg/dxva_vc1_crash.patch
=====================================
@@ -1,7 +1,7 @@
 From 2dbcebff1e80541d8aa71041f36a086856987373 Mon Sep 17 00:00:00 2001
 From: Steve Lhomme <robux4 at ycbcr.xyz>
 Date: Tue, 23 Jan 2018 13:01:22 +0100
-Subject: [PATCH 8/9] fix crash on bogus frame reference in VC1/MPEG-2 with
+Subject: [PATCH 8/9] fix crash on bogus frame reference in MPEG-2 with
  DXVA
 
 ---
@@ -18,30 +18,12 @@ index d88e782414..c3097cb6e5 100644
      memset(pp, 0, sizeof(*pp));
      pp->wDeblockedPictureIndex       = 0;
 -    if (s->pict_type != AV_PICTURE_TYPE_I)
-+    if (s->pict_type != AV_PICTURE_TYPE_I && s->last_pic.data[0])
++    if (s->pict_type != AV_PICTURE_TYPE_I && s->last_pic.ptr)
          pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0);
      else
          pp->wForwardRefPictureIndex  = 0xffff;
 -    if (s->pict_type == AV_PICTURE_TYPE_B)
-+    if (s->pict_type == AV_PICTURE_TYPE_B && s->next_pic.data[0])
-         pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0);
-     else
-         pp->wBackwardRefPictureIndex = 0xffff;
-diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c
-index bc9ad9648e..b7608228b0 100644
---- a/libavcodec/dxva2_vc1.c
-+++ b/libavcodec/dxva2_vc1.c
-@@ -58,11 +58,11 @@ void ff_dxva2_vc1_fill_picture_parameters(AVCodecContext *avctx,
-     }
- 
-     memset(pp, 0, sizeof(*pp));
--    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_pic.ptr)
-+    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_pic.ptr && s->last_pic.data[0])
-         pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_pic.ptr->f, 0);
-     else
-         pp->wForwardRefPictureIndex = 0xffff;
--    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_pic.ptr)
-+    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_pic.ptr && s->next_pic.data[0])
++    if (s->pict_type == AV_PICTURE_TYPE_B && s->next_pic.ptr)
          pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_pic.ptr->f, 0);
      else
          pp->wBackwardRefPictureIndex = 0xffff;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/89615d0ea72d14052168cf0a1991bff597da5101

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/89615d0ea72d14052168cf0a1991bff597da5101
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list