aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-11-20 00:43:45 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-12-02 00:28:33 +0100
commit71b3f64935dd17af574dcd86b55e296f2e67fac5 (patch)
tree690ce2b43b7c520c3d0a47270759d442dcd3a048
parent69a92ae39711f844480dd47b9aa2f30346f3e1ce (diff)
downloadffmpeg-71b3f64935dd17af574dcd86b55e296f2e67fac5.tar.gz
swscale/x86/rgb2rgb_template: handle the first 2 lines with C in rgb24toyv12_*()
This avoids out of array accesses Should fix Ticket3451 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 4388e78a0f022c8572996f9ab568a39b5f716f9d) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libswscale/x86/rgb2rgb_template.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libswscale/x86/rgb2rgb_template.c b/libswscale/x86/rgb2rgb_template.c
index d802ab4227..b02296688d 100644
--- a/libswscale/x86/rgb2rgb_template.c
+++ b/libswscale/x86/rgb2rgb_template.c
@@ -1616,6 +1616,16 @@ static inline void RENAME(rgb24toyv12)(const uint8_t *src, uint8_t *ydst, uint8_
{
int y;
const x86_reg chromWidth= width>>1;
+
+ if (height > 2) {
+ rgb24toyv12_c(src, ydst, udst, vdst, width, 2, lumStride, chromStride, srcStride);
+ src += 2*srcStride;
+ ydst += 2*lumStride;
+ udst += chromStride;
+ vdst += chromStride;
+ height -= 2;
+ }
+
for (y=0; y<height-2; y+=2) {
int i;
for (i=0; i<2; i++) {