summaryrefslogtreecommitdiffstats
path: root/video/mp_image.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-04-25 11:28:49 +0200
committerwm4 <wm4@nowhere>2016-04-25 11:28:49 +0200
commit021cb2c3870b9d0b2f2e03416702fc561f160c2b (patch)
tree659ac3ff21f104e722539651b6900717e570f5a3 /video/mp_image.c
parente232f1a731a9089a13d88def6c1f2c1a069a6353 (diff)
downloadmpv-021cb2c3870b9d0b2f2e03416702fc561f160c2b.tar.bz2
mpv-021cb2c3870b9d0b2f2e03416702fc561f160c2b.tar.xz
mp_image: allow passing NULL to mp_image_new_custom_ref()
A minor simplification. Most callers don't need this, and there's no good reason why the caller should provide an "initializer" like this. (This function calls mp_image_new_dummy_ref(), which has no reason for an initializer either.)
Diffstat (limited to 'video/mp_image.c')
-rw-r--r--video/mp_image.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/video/mp_image.c b/video/mp_image.c
index 0ca59c62c9..5adce213e5 100644
--- a/video/mp_image.c
+++ b/video/mp_image.c
@@ -230,7 +230,7 @@ struct mp_image *mp_image_new_dummy_ref(struct mp_image *img)
{
struct mp_image *new = talloc_ptrtype(NULL, new);
talloc_set_destructor(new, mp_image_destructor);
- *new = *img;
+ *new = img ? *img : (struct mp_image){0};
for (int p = 0; p < MP_MAX_PLANES; p++)
new->bufs[p] = NULL;
new->hwctx = NULL;