[vlc-commits] dxva2: allocate the requested number of surfaces

Steve Lhomme git at videolan.org
Tue Aug 2 11:24:56 CEST 2016


vlc | branch: master | Steve Lhomme <robUx4 at videolabs.io> | Tue Aug  2 11:15:07 2016 +0200| [af4f23a8866e7c111e7ef43381123633b6ea15c4] | committer: Jean-Baptiste Kempf

dxva2: allocate the requested number of surfaces

The +1 of CreateSurface is an internal thing. There are cases where the
allocation succeeds but the use of buffer crashes as soon as we do BeginFrame().
This change fixes this crash. Either we can allocate and it works, either we
can't allocate and it won't crash.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/codec/avcodec/dxva2.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/modules/codec/avcodec/dxva2.c b/modules/codec/avcodec/dxva2.c
index 583a236..f08865f 100644
--- a/modules/codec/avcodec/dxva2.c
+++ b/modules/codec/avcodec/dxva2.c
@@ -703,7 +703,7 @@ static int DxCreateVideoDecoder(vlc_va_t *va, int codec_id, const video_format_t
     hr = IDirectXVideoDecoderService_CreateSurface((IDirectXVideoDecoderService*) sys->d3ddec,
                                                          sys->surface_width,
                                                          sys->surface_height,
-                                                         sys->surface_count - 1,
+                                                         sys->surface_count,
                                                          p_sys->render,
                                                          D3DPOOL_DEFAULT,
                                                          0,



More information about the vlc-commits mailing list