mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-27 01:42:20 +00:00
Port MPlayer fixes for coverity issues in libmpcodecs.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
parent
425c30ddae
commit
5f9cbad603
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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]);
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user