diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2008-03-03 19:53:27 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2008-03-03 19:53:27 +0000 |
commit | f15e6b869fc1ff3ffef1b1ac7b394e2155b5fafe (patch) | |
tree | 4b21d9f10ab30ee62cc2cadafa17c03305bdc8aa | |
parent | 6548ff57c0637337741c7fb837c218f738a70d7c (diff) | |
download | ffmpeg-streaming-f15e6b869fc1ff3ffef1b1ac7b394e2155b5fafe.zip ffmpeg-streaming-f15e6b869fc1ff3ffef1b1ac7b394e2155b5fafe.tar.gz |
Provide non null class name to avoid crash with ffmpeg -h.
Originally committed as revision 12300 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/imgresample.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/imgresample.c b/libavcodec/imgresample.c index c481e9d..e2cc0c2 100644 --- a/libavcodec/imgresample.c +++ b/libavcodec/imgresample.c @@ -512,6 +512,8 @@ void img_resample_close(ImgReSampleContext *s) av_free(s); } +static const AVClass context_class = { "imgresample", NULL, NULL }; + struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH, int dstFormat, int flags, SwsFilter *srcFilter, @@ -520,13 +522,12 @@ struct SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, struct SwsContext *ctx; ctx = av_malloc(sizeof(struct SwsContext)); - if (ctx) - ctx->av_class = av_mallocz(sizeof(AVClass)); - if (!ctx || !ctx->av_class) { + if (!ctx) { av_log(NULL, AV_LOG_ERROR, "Cannot allocate a resampling context!\n"); return NULL; } + ctx->av_class = &context_class; if ((srcH != dstH) || (srcW != dstW)) { if ((srcFormat != PIX_FMT_YUV420P) || (dstFormat != PIX_FMT_YUV420P)) { |