diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-17 04:24:24 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-17 14:40:59 +0200 |
commit | 21d82554236b7f566da93e83f87676129b530ffd (patch) | |
tree | c769da5b37f74daecb78da71d90d670f930c57c8 /libswscale/utils.c | |
parent | 22a279539e2104c2ce68ec3e8f9849d982583511 (diff) | |
download | ffmpeg-streaming-21d82554236b7f566da93e83f87676129b530ffd.zip ffmpeg-streaming-21d82554236b7f566da93e83f87676129b530ffd.tar.gz |
sws: handle non native rgb<->rgb convertions
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/utils.c')
-rw-r--r-- | libswscale/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/utils.c b/libswscale/utils.c index 4047fb5..a6bb732 100644 --- a/libswscale/utils.c +++ b/libswscale/utils.c @@ -996,6 +996,8 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) c->chrDstW = -((-dstW) >> c->chrDstHSubSample); c->chrDstH = -((-dstH) >> c->chrDstVSubSample); + FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail); + /* unscaled special cases */ if (unscaled && !usesHFilter && !usesVFilter && (c->srcRange == c->dstRange || isAnyRGB(dstFormat))) { @@ -1020,7 +1022,6 @@ int sws_init_context(SwsContext *c, SwsFilter *srcFilter, SwsFilter *dstFilter) c->srcBpc = 16; if (c->dstBpc == 16) dst_stride <<= 1; - FF_ALLOC_OR_GOTO(c, c->formatConvBuffer, FFALIGN(srcW*2+78, 16) * 2, fail); if (HAVE_MMX2 && cpu_flags & AV_CPU_FLAG_MMX2 && c->srcBpc == 8 && c->dstBpc <= 14) { c->canMMX2BeUsed = (dstW >= srcW && (dstW & 31) == 0 && |