1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-11 09:25:56 +00:00

vf_expand: fix memory leak on memory allocation failure

Isn't it ironic.
This commit is contained in:
wm4 2015-03-20 00:38:29 +01:00
parent 055720fbce
commit 25c8bf8754

View File

@ -113,8 +113,10 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
return mpi; return mpi;
struct mp_image *dmpi = vf_alloc_out_image(vf); struct mp_image *dmpi = vf_alloc_out_image(vf);
if (!dmpi) if (!dmpi) {
talloc_free(mpi);
return NULL; return NULL;
}
mp_image_copy_attributes(dmpi, mpi); mp_image_copy_attributes(dmpi, mpi);
struct mp_image cropped = *dmpi; struct mp_image cropped = *dmpi;