summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_pp.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-29 01:20:51 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-29 01:20:51 +0000
commit63ee919e14d47940d3aae1dd51af65f59657c8f2 (patch)
tree9227b7d0647394c909941fd2e8e5ce2b754405d1 /libmpcodecs/vf_pp.c
parentaf0d4b8c60888bbc8d38d79de7434c371478e558 (diff)
downloadmpv-63ee919e14d47940d3aae1dd51af65f59657c8f2.tar.bz2
mpv-63ee919e14d47940d3aae1dd51af65f59657c8f2.tar.xz
fixing segfault
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7950 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_pp.c')
-rw-r--r--libmpcodecs/vf_pp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c
index 47801ab481..b3e9e61004 100644
--- a/libmpcodecs/vf_pp.c
+++ b/libmpcodecs/vf_pp.c
@@ -25,13 +25,15 @@ struct vf_priv_s {
static int config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height,
unsigned int voflags, unsigned int outfmt){
-
- if(vf->priv->context) freePPContext(vf->priv->context);
vf->priv->context= getPPContext(width, height);
return vf_next_config(vf,width,height,d_width,d_height,voflags,vf->priv->outfmt);
}
+static void uninit(struct vf_instance_s* vf){
+ if(vf->priv->context) freePPContext(vf->priv->context);
+}
+
static int query_format(struct vf_instance_s* vf, unsigned int fmt){
switch(fmt){
case IMGFMT_YV12:
@@ -118,8 +120,10 @@ static int open(vf_instance_t *vf, char* args){
vf->config=config;
vf->get_image=get_image;
vf->put_image=put_image;
+ vf->uninit=uninit;
vf->default_caps=VFCAP_ACCEPT_STRIDE|VFCAP_POSTPROC;
vf->priv=malloc(sizeof(struct vf_priv_s));
+ vf->priv->context=NULL;
// check csp:
vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12);