aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer2017-09-17 00:17:42 -0300
committerJames Almer2017-09-19 19:30:08 -0300
commit18516d3e695980525bd9758dc7b8a8e36cd3f09e (patch)
tree51b937c38a52c25bd83c7c974bd8b6ff548cdce3
parentf952edaa73ee8618fcc8c105b57b9032ca0d1cec (diff)
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>
-rw-r--r--libavutil/hwcontext_dxva2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index 6c41788e2e..2ddd4be7b1 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -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);