[FFmpeg-devel] [PATCH] Implement pixdesctest filter
Michael Niedermayer
michaelni
Tue Feb 2 12:34:04 CET 2010
On Tue, Feb 02, 2010 at 12:08:14AM +0100, Stefano Sabatini wrote:
> Hi, this filter is useful for testing/pedagogical purposes, so I'd
> like to commit it even if we don't still have a test for lavfi.
[...]
> +static av_cold void uninit(AVFilterContext *ctx)
> +{
> + PixdescTestContext *priv = ctx->priv;
> + av_free(priv->line);
please use av_freep() for everything except local variables
avoids double frees and access to freed memory
[...]
> +static void draw_slice(AVFilterLink *inlink, int y, int h, int slice_dir)
> +{
> + PixdescTestContext *priv = inlink->dst->priv;
> + int i, c, w = inlink->w;
> +
> + AVFilterPicRef *inpic = inlink->cur_pic;
> + AVFilterPicRef *outpic = inlink->dst->outputs[0]->outpic;
> +
> + /* clear destination picture */
> + for (c = 0; c < priv->pix_desc->nb_components; c++) {
> + int h1 = c == 1 || c == 2 ? h>>priv->pix_desc->log2_chroma_h : h;
> + int y1 = c == 1 || c == 2 ? y>>priv->pix_desc->log2_chroma_h : y;
does that work with odd y/h ?
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
Let us carefully observe those good qualities wherein our enemies excel us
and endeavor to excel them, by avoiding what is faulty, and imitating what
is excellent in them. -- Plutarch
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100202/324fda44/attachment.pgp>
More information about the ffmpeg-devel
mailing list