diff options
author | Benoit Fouet <benoit.fouet@free.fr> | 2007-06-26 16:09:55 +0000 |
---|---|---|
committer | Benoit Fouet <benoit.fouet@free.fr> | 2007-06-26 16:09:55 +0000 |
commit | 57ae779d41ed503f0f43e0a929c0ddd44d9d6fe6 (patch) | |
tree | 3b9109cde21de71cd4c7178beb3a4bd310bfc6c3 | |
parent | 29cc1c23d14a4e708f5106e1703b4939a25c514b (diff) | |
download | ffmpeg-57ae779d41ed503f0f43e0a929c0ddd44d9d6fe6.tar.gz |
add an AVClass pointer in SwsContext context
Originally committed as revision 9434 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/imgresample.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c index 8174d38e01..4ed7e8c415 100644 --- a/libavcodec/imgresample.c +++ b/libavcodec/imgresample.c @@ -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 *sws_getContext(int srcW, int srcH, int srcFormat, 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 @@ void sws_freeContext(struct SwsContext *ctx) } else { av_free(ctx->resampling_ctx); } + av_free(ctx->av_class); av_free(ctx); } |