libmpcodecs: fix coverity issues

Fix check for empty log file (n contains a start offset of 15).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35269 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar

Add missing ().

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35270 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar

Conflicts:
	libmpcodecs/vf_down3dright.c

Add comment to silence coverity (and it generally doesn't
hurt to make intentional fallthrough cases explicit).

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35271 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar

Make uninit function handle vf->priv being NULL.

This happens in the case where memory allocation for it fails.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35272 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar

Remove useless variable.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35273 b3059339-0415-0410-9bf9-f77b7e298cf2
Author: reimar

Conflicts:
	libmpcodecs/vf_softpulldown.c
This commit is contained in:
reimar 2012-10-26 18:05:30 +00:00 committed by wm4
parent 1215f0871c
commit a0d7595206
5 changed files with 17 additions and 17 deletions

View File

@ -415,7 +415,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);

View File

@ -100,12 +100,12 @@ static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)
{
mp_image_t *dmpi;
// 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,
mpi->w * vf->priv->scalew,
mpi->h / vf->priv->scaleh - vf->priv->skipline);
// 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),
mpi->w * vf->priv->scalew,
mpi->h / vf->priv->scaleh - vf->priv->skipline);
toright(dmpi->planes, mpi->planes, dmpi->stride,
mpi->stride, mpi->w, mpi->h, vf->priv);

View File

@ -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;

View File

@ -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]);

View File

@ -163,16 +163,13 @@ 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->state = 0;
vf->priv->last_frame_duration = 2;
vf_detc_init_pts_buf(&vf->priv->ptsbuf);
return 1;
vf->config = config;
vf->put_image = put_image;
vf->uninit = uninit;
vf->default_reqs = VFCAP_ACCEPT_STRIDE;
vf->priv = calloc(1, sizeof(struct vf_priv_s));
vf->priv->state = 0;
return 1;
}
const vf_info_t vf_info_softpulldown = {