[FFmpeg-devel] [PATCH] ffmpeg_dxva2: set AVFrame.data[0] to the surface pointer as well

Hendrik Leppkes h.leppkes at gmail.com
Thu Oct 15 13:55:58 CEST 2015


On Thu, Oct 15, 2015 at 1:29 PM, Hendrik Leppkes <h.leppkes at gmail.com> wrote:
> Some decoders specifically test if data[0] is set to check if a frame is
> valid. This allows these checks to pass and decoding to continue.
> ---
>  ffmpeg_dxva2.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/ffmpeg_dxva2.c b/ffmpeg_dxva2.c
> index 905bf89..8641a0d 100644
> --- a/ffmpeg_dxva2.c
> +++ b/ffmpeg_dxva2.c
> @@ -248,6 +248,7 @@ static int dxva2_get_buffer(AVCodecContext *s, AVFrame *frame, int flags)
>      ctx->surface_infos[i].used = 1;
>      ctx->surface_infos[i].age  = ctx->surface_age++;
>
> +    frame->data[0] =
>      frame->data[3] = (uint8_t *)surface;
>
>      return 0;
> --
> 2.5.3.windows.1
>

Disregard this patch, apparently data[0] not being set is considered
perfectly fine for HWAccel decoding and usage in a check would be a
bug.
Another patch to fix such bugs incoming.


More information about the ffmpeg-devel mailing list