Mercurial > libavcodec.hg
changeset 5185:a81dc8cc24fa libavcodec
add an AVClass pointer in SwsContext context
author | benoit |
---|---|
date | Tue, 26 Jun 2007 16:09:55 +0000 |
parents | f3873cd7f473 |
children | 8a6fac216a2f |
files | imgresample.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/imgresample.c Mon Jun 25 12:09:23 2007 +0000 +++ b/imgresample.c Tue Jun 26 16:09:55 2007 +0000 @@ -44,6 +44,7 @@ #define LINE_BUF_HEIGHT (NB_TAPS * 4) struct SwsContext { + AVClass *av_class; struct ImgReSampleContext *resampling_ctx; enum PixelFormat src_pix_fmt, dst_pix_fmt; }; @@ -642,7 +643,8 @@ struct SwsContext *ctx; ctx = av_malloc(sizeof(struct SwsContext)); - if (ctx == NULL) { + ctx->av_class = av_mallocz(sizeof(AVClass)); + if (!ctx || !ctx->av_class) { av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n"); return NULL; @@ -676,6 +678,7 @@ } else { av_free(ctx->resampling_ctx); } + av_free(ctx->av_class); av_free(ctx); }