[vlc-commits] contrib: ffmpeg: fix existing surface check in DVXA2

Steve Lhomme git at videolan.org
Fri Feb 12 06:59:22 UTC 2021


vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Fri Feb 12 07:57:15 2021 +0100| [e7c128a9b94c6c139132ce1a98accb048ec74caa] | committer: Steve Lhomme

contrib: ffmpeg: fix existing surface check in DVXA2

Since 3804ff2dffc2a46ead5598881d0a08db977000d3 data[0] is not filled anymore.
The proper way to check a surface is set is to use buf[0] as used in VP9 and VC1
DXVA2 decoders.

Ref. #18916

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=e7c128a9b94c6c139132ce1a98accb048ec74caa
---

 contrib/src/ffmpeg/dxva_vc1_crash.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/src/ffmpeg/dxva_vc1_crash.patch b/contrib/src/ffmpeg/dxva_vc1_crash.patch
index 3e5c3ed683..6ab9d434f3 100644
--- a/contrib/src/ffmpeg/dxva_vc1_crash.patch
+++ b/contrib/src/ffmpeg/dxva_vc1_crash.patch
@@ -5,12 +5,12 @@
      pp->wDecodedPictureIndex    =
      pp->wDeblockedPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
 -    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type)
-+    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_picture.f->data[0])
++    if (s->pict_type != AV_PICTURE_TYPE_I && !v->bi_type && s->last_picture.f->buf[0])
          pp->wForwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
      else
          pp->wForwardRefPictureIndex = 0xffff;
 -    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type)
-+    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_picture.f->data[0])
++    if (s->pict_type == AV_PICTURE_TYPE_B && !v->bi_type && s->next_picture.f->buf[0])
          pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
      else
          pp->wBackwardRefPictureIndex = 0xffff;
@@ -21,12 +21,12 @@
      pp->wDecodedPictureIndex         = ff_dxva2_get_surface_index(avctx, ctx, current_picture->f);
      pp->wDeblockedPictureIndex       = 0;
 -    if (s->pict_type != AV_PICTURE_TYPE_I)
-+    if (s->pict_type != AV_PICTURE_TYPE_I && s->last_picture.f->data[0])
++    if (s->pict_type != AV_PICTURE_TYPE_I && s->last_picture.f->buf[0])
          pp->wForwardRefPictureIndex  = ff_dxva2_get_surface_index(avctx, ctx, s->last_picture.f);
      else
          pp->wForwardRefPictureIndex  = 0xffff;
 -    if (s->pict_type == AV_PICTURE_TYPE_B)
-+    if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture.f->data[0])
++    if (s->pict_type == AV_PICTURE_TYPE_B && s->next_picture.f->buf[0])
          pp->wBackwardRefPictureIndex = ff_dxva2_get_surface_index(avctx, ctx, s->next_picture.f);
      else
          pp->wBackwardRefPictureIndex = 0xffff;



More information about the vlc-commits mailing list