summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2012-10-26 18:05:30 +0000
committerwm4 <wm4@nowhere>2012-10-30 19:50:20 +0100
commita0d7595206e8f536aaf14beb65015e50ceb4f32c (patch)
tree77e3b68a455036ae7548d8a0562aab6bbd6814fe
parent1215f0871cd7aa4e5aaca85fe86acffa6da0463e (diff)
downloadmpv-a0d7595206e8f536aaf14beb65015e50ceb4f32c.tar.bz2
mpv-a0d7595206e8f536aaf14beb65015e50ceb4f32c.tar.xz
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
-rw-r--r--libmpcodecs/vf_divtc.c2
-rw-r--r--libmpcodecs/vf_down3dright.c12
-rw-r--r--libmpcodecs/vf_ilpack.c1
-rw-r--r--libmpcodecs/vf_phase.c2
-rw-r--r--libmpcodecs/vf_softpulldown.c17
5 files changed, 17 insertions, 17 deletions
diff --git a/libmpcodecs/vf_divtc.c b/libmpcodecs/vf_divtc.c
index e04e7c0b4e..6faeb7c411 100644
--- a/libmpcodecs/vf_divtc.c
+++ b/libmpcodecs/vf_divtc.c
@@ -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);
diff --git a/libmpcodecs/vf_down3dright.c b/libmpcodecs/vf_down3dright.c
index 1119618e78..a263661592 100644
--- a/libmpcodecs/vf_down3dright.c
+++ b/libmpcodecs/vf_down3dright.c
@@ -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);
diff --git a/libmpcodecs/vf_ilpack.c b/libmpcodecs/vf_ilpack.c
index db4a849e1f..e98d70d85d 100644
--- a/libmpcodecs/vf_ilpack.c
+++ b/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/libmpcodecs/vf_phase.c b/libmpcodecs/vf_phase.c
index b9ea66c506..f5d937ef70 100644
--- a/libmpcodecs/vf_phase.c
+++ b/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/libmpcodecs/vf_softpulldown.c b/libmpcodecs/vf_softpulldown.c
index 5bd5e66bfd..d07f9d6e26 100644
--- a/libmpcodecs/vf_softpulldown.c
+++ b/libmpcodecs/vf_softpulldown.c
@@ -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 = {