summaryrefslogtreecommitdiffstats
path: root/video
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-05-26 17:10:32 +0200
committerwm4 <wm4@nowhere>2013-05-26 17:13:09 +0200
commit3edb8fb71c7bc38ad0b183d875c53d64e69a0e26 (patch)
treeb6f7f20397798c419cef7c30a05d2e9344b0a8f4 /video
parentf55f99ce1909a7a5a1ab7bcad87badaa7c609138 (diff)
downloadmpv-3edb8fb71c7bc38ad0b183d875c53d64e69a0e26.tar.bz2
mpv-3edb8fb71c7bc38ad0b183d875c53d64e69a0e26.tar.xz
vf_delogo: copy in non-direct case, fix double-free
If the image is not writeable, the image actually has to be copied beforehand. This was overlooked when converting the video chain to reference counted images. Fix a double free issue. This was overlooked when vf.c was changed to free filter priv data automatically.
Diffstat (limited to 'video')
-rw-r--r--video/filter/vf_delogo.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/video/filter/vf_delogo.c b/video/filter/vf_delogo.c
index 346eb468f5..d90d852057 100644
--- a/video/filter/vf_delogo.c
+++ b/video/filter/vf_delogo.c
@@ -179,6 +179,7 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
if (!mp_image_is_writeable(mpi)) {
dmpi = vf_alloc_out_image(vf);
mp_image_copy_attributes(dmpi, mpi);
+ mp_image_copy(dmpi, mpi);
}
if (vf->priv->timed_rect)
@@ -195,13 +196,6 @@ static struct mp_image *filter(struct vf_instance *vf, struct mp_image *mpi)
return dmpi;
}
-static void uninit(struct vf_instance *vf){
- if(!vf->priv) return;
-
- free(vf->priv);
- vf->priv=NULL;
-}
-
//===========================================================================//
static int query_format(struct vf_instance *vf, unsigned int fmt){
@@ -290,7 +284,6 @@ static int vf_open(vf_instance_t *vf, char *args){
vf->config=config;
vf->filter=filter;
vf->query_format=query_format;
- vf->uninit=uninit;
if (vf->priv->file) {
if (load_timed_rectangles(vf->priv))
@@ -305,7 +298,6 @@ static int vf_open(vf_instance_t *vf, char *args){
vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_420P);
if(!vf->priv->outfmt)
{
- uninit(vf);
return 0; // no csp match :(
}