Browse Source

avutil/hwcontext_dxva2: return an error when buffer allocation fails

This also prevents the use of an uninitialized variable.

Reviewed-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: James Almer <jamrial@gmail.com>
tags/n3.4
James Almer 8 years ago
parent
commit
18516d3e69
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavutil/hwcontext_dxva2.c

+ 3
- 1
libavutil/hwcontext_dxva2.c View File

@@ -307,8 +307,10 @@ static int dxva2_map_frame(AVHWFramesContext *ctx, AVFrame *dst, const AVFrame *
}

map = av_mallocz(sizeof(*map));
if (!map)
if (!map) {
err = AVERROR(ENOMEM);
goto fail;
}

err = ff_hwframe_map_create(src->hw_frames_ctx, dst, src,
dxva2_unmap_frame, map);


Loading…
Cancel
Save