summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-06-29 15:10:17 +0200
committerwm4 <wm4@nowhere>2015-06-29 15:10:17 +0200
commite0b1b88e8367f7d31ee4a4dcdc25c8d0676e6911 (patch)
tree3425a0005070a951da986342ff5ed6994d2490e6
parentd660e67be9cc7d79d81e0c09c2720ea6d0a35e3a (diff)
downloadmpv-e0b1b88e8367f7d31ee4a4dcdc25c8d0676e6911.tar.bz2
mpv-e0b1b88e8367f7d31ee4a4dcdc25c8d0676e6911.tar.xz
vaapi: fix potential NULL deref on memory allocation failure
-rw-r--r--video/vaapi.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/video/vaapi.c b/video/vaapi.c
index bcae33d410..7ba07b9a2c 100644
--- a/video/vaapi.c
+++ b/video/vaapi.c
@@ -395,11 +395,12 @@ static struct mp_image *try_download(struct mp_image *src,
struct mp_image tmp;
if (va_image_map(p->ctx, image, &tmp)) {
dst = mp_image_pool_get(pool, tmp.imgfmt, tmp.w, tmp.h);
- if (dst)
+ if (dst) {
mp_image_copy(dst, &tmp);
+ mp_image_copy_attributes(dst, src);
+ }
va_image_unmap(p->ctx, image);
}
- mp_image_copy_attributes(dst, src);
return dst;
}