summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-03-20 00:38:29 +0100
committerwm4 <wm4@nowhere>2015-03-20 00:38:29 +0100
commit25c8bf8754b5981911b60e3cd72b9a428035afe3 (patch)
treea1e145aa030ba96cf2b7d20c05706c9ade0f4029
parent055720fbce526c120921391f4096d956ed2e725f (diff)
downloadmpv-25c8bf8754b5981911b60e3cd72b9a428035afe3.tar.bz2
mpv-25c8bf8754b5981911b60e3cd72b9a428035afe3.tar.xz
vf_expand: fix memory leak on memory allocation failure
Isn't it ironic.
-rw-r--r--video/filter/vf_expand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/video/filter/vf_expand.c b/video/filter/vf_expand.c
index db01bd4324..80503b4176 100644
--- a/video/filter/vf_expand.c
+++ b/video/filter/vf_expand.c
@@ -113,8 +113,10 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
return mpi;
struct mp_image *dmpi = vf_alloc_out_image(vf);
- if (!dmpi)
+ if (!dmpi) {
+ talloc_free(mpi);
return NULL;
+ }
mp_image_copy_attributes(dmpi, mpi);
struct mp_image cropped = *dmpi;