diff --git a/libavfilter/libmpcodecs/vf_divtc.c b/libavfilter/libmpcodecs/vf_divtc.c index 4c171d1728..32064a5ed0 100644 --- a/libavfilter/libmpcodecs/vf_divtc.c +++ b/libavfilter/libmpcodecs/vf_divtc.c @@ -413,7 +413,7 @@ static int analyze(struct vf_priv_s *p) n++; } - if(!n) + if(n <= 15) { mp_msg(MSGT_VFILTER, MSGL_FATAL, "%s: Empty 2-pass log file.\n", vf_info_divtc.name); diff --git a/libavfilter/libmpcodecs/vf_down3dright.c b/libavfilter/libmpcodecs/vf_down3dright.c index 4dba19a2f0..f1e1f49b05 100644 --- a/libavfilter/libmpcodecs/vf_down3dright.c +++ b/libavfilter/libmpcodecs/vf_down3dright.c @@ -103,7 +103,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) // hope we'll get DR buffer: dmpi=vf_get_image(vf->next, IMGFMT_YV12, MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE | - (vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0, + ((vf->priv->scaleh == 1) ? MP_IMGFLAG_READABLE : 0), mpi->w * vf->priv->scalew, mpi->h / vf->priv->scaleh - vf->priv->skipline); diff --git a/libavfilter/libmpcodecs/vf_ilpack.c b/libavfilter/libmpcodecs/vf_ilpack.c index db4a849e1f..e98d70d85d 100644 --- a/libavfilter/libmpcodecs/vf_ilpack.c +++ b/libavfilter/libmpcodecs/vf_ilpack.c @@ -437,6 +437,7 @@ static int vf_open(vf_instance_t *vf, char *args) mp_msg(MSGT_VFILTER, MSGL_WARN, "ilpack: unknown mode %d (fallback to linear)\n", vf->priv->mode); + /* Fallthrough */ case 1: vf->priv->pack[0] = pack_li_0; vf->priv->pack[1] = pack_li_1; diff --git a/libavfilter/libmpcodecs/vf_phase.c b/libavfilter/libmpcodecs/vf_phase.c index 7dd642ebc0..101290dec5 100644 --- a/libavfilter/libmpcodecs/vf_phase.c +++ b/libavfilter/libmpcodecs/vf_phase.c @@ -242,6 +242,8 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) static void uninit(struct vf_instance *vf) { + if (!vf->priv) + return; free(vf->priv->buf[0]); free(vf->priv->buf[1]); free(vf->priv->buf[2]); diff --git a/libavfilter/libmpcodecs/vf_softpulldown.c b/libavfilter/libmpcodecs/vf_softpulldown.c index 04d1eae3d4..1a66e5607b 100644 --- a/libavfilter/libmpcodecs/vf_softpulldown.c +++ b/libavfilter/libmpcodecs/vf_softpulldown.c @@ -144,12 +144,11 @@ static void uninit(struct vf_instance *vf) static int vf_open(vf_instance_t *vf, char *args) { - struct vf_priv_s *p; vf->config = config; vf->put_image = put_image; vf->uninit = uninit; vf->default_reqs = VFCAP_ACCEPT_STRIDE; - vf->priv = p = calloc(1, sizeof(struct vf_priv_s)); + vf->priv = calloc(1, sizeof(struct vf_priv_s)); vf->priv->state = 0; return 1; } diff --git a/libavfilter/libmpcodecs/vf_telecine.c b/libavfilter/libmpcodecs/vf_telecine.c index 3b92518c84..e5f934ef0c 100644 --- a/libavfilter/libmpcodecs/vf_telecine.c +++ b/libavfilter/libmpcodecs/vf_telecine.c @@ -62,6 +62,7 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts) dmpi->stride[2]*2, mpi->stride[2]*2); } ret = vf_next_put_image(vf, dmpi, MP_NOPTS_VALUE); + /* Fallthrough */ case 1: case 2: memcpy_pic(dmpi->planes[0], mpi->planes[0], mpi->w, mpi->h, diff --git a/libavfilter/libmpcodecs/vf_tinterlace.c b/libavfilter/libmpcodecs/vf_tinterlace.c index 6dbcbc9481..8cd6ac89b6 100644 --- a/libavfilter/libmpcodecs/vf_tinterlace.c +++ b/libavfilter/libmpcodecs/vf_tinterlace.c @@ -218,10 +218,10 @@ static int vf_open(vf_instance_t *vf, char *args) vf->uninit = uninit; vf->default_reqs = VFCAP_ACCEPT_STRIDE; vf->priv = p = calloc(1, sizeof(struct vf_priv_s)); - vf->priv->mode = 0; + p->mode = 0; if (args) - sscanf(args, "%d", &vf->priv->mode); - vf->priv->frame = 0; + sscanf(args, "%d", &p->mode); + p->frame = 0; return 1; }