diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2011-05-27 20:23:32 +0400 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-05-27 21:22:27 +0400 |
commit | 389e2000ebc299b9da24f7e5faf9a68a88f9ee7c (patch) | |
tree | 39af74d6d254b7543b74ff97d2d781c4aa202b7e | |
parent | f327bfa6dcdbce4593213c30a328d8aaf7a4b86b (diff) |
swscale: delay allocation of formatConvBuffer().
That means it won't be allocated when not needed. Alongside
this, it fixes valgrind/fate-detected memory leaks.
-rw-r--r-- | libswscale/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 15ed9d1ce6..571f45be3d 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -791,7 +791,6 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) srcW, srcH, dstW, dstH); return AVERROR(EINVAL); } - FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW, 16) * 2, fail); if (!dstFilter) dstFilter= &dummyFilter; if (!srcFilter) srcFilter= &dummyFilter; @@ -847,6 +846,7 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) } } + FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW, 16) * 2, fail); if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2) { c->canMMX2BeUsed= (dstW >=srcW && (dstW&31)==0 && (srcW&15)==0) ? 1 : 0; if (!c->canMMX2BeUsed && dstW >=srcW && (srcW&15)==0 && (flags&SWS_FAST_BILINEAR)) { |