aboutsummaryrefslogtreecommitdiffstats
path: root/libswscale/swscale.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-10-25 15:00:28 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-10-25 15:00:28 +0000
commit9b0d44ef678a1c1997213e3eb5cc68a11d4b3960 (patch)
treea204a28872d77ceb03054a449b696f9aabc7b5c1 /libswscale/swscale.c
parentc87348a9223eb0e619fcf6b476fe79ea3ceeb495 (diff)
downloadffmpeg-9b0d44ef678a1c1997213e3eb5cc68a11d4b3960.tar.gz
Do not attempt to use the unscaled yuv2rgb converter when height is odd because
it will overflow the buffer by 1 line. This might have been exploitable. Originally committed as revision 27826 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index a926bade05..62c0548fd5 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -2312,7 +2312,7 @@ SwsContext *sws_getContext(int srcW, int srcH, enum PixelFormat srcFormat, int d
#ifdef CONFIG_GPL
/* yuv2bgr */
if ((srcFormat==PIX_FMT_YUV420P || srcFormat==PIX_FMT_YUV422P) && (isBGR(dstFormat) || isRGB(dstFormat))
- && !(flags & SWS_ACCURATE_RND))
+ && !(flags & SWS_ACCURATE_RND) && !(dstH&1))
{
c->swScale= yuv2rgb_get_func_ptr(c);
}