summaryrefslogtreecommitdiff
path: root/libswscale/swscale_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2008-09-09 03:35:07 +0000
committerMichael Niedermayer <michaelni@gmx.at>2008-09-09 03:35:07 +0000
commitaa13b0fc55f5aec58fce24d1a047271b3e5727f1 (patch)
treefde9a8886e14a1bd280bdeb8a9fd4bc917b54c6c /libswscale/swscale_template.c
parent66ec3d56a2b1df959d53d65c5bb80bc76740580d (diff)
Prevent overflows during mpeg->jpeg yuv.
Originally committed as revision 27552 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
Diffstat (limited to 'libswscale/swscale_template.c')
-rw-r--r--libswscale/swscale_template.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index ef964ff8ef..be7009c7ce 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -2721,7 +2721,7 @@ FUNNY_Y_CODE
dst[i]= (dst[i]*14071 + 33561947)>>14;
}else{
for (i=0; i<dstWidth; i++)
- dst[i]= (dst[i]*19077 - 39057361)>>14;
+ dst[i]= (FFMIN(dst[i],30189)*19077 - 39057361)>>14;
}
}
}
@@ -2986,8 +2986,8 @@ FUNNY_UV_CODE
}
}else{
for (i=0; i<dstWidth; i++){
- dst[i ]= (dst[i ]*4663 - 9289992)>>12; //-264
- dst[i+VOFW]= (dst[i+VOFW]*4663 - 9289992)>>12; //-264
+ dst[i ]= (FFMIN(dst[i ],30775)*4663 - 9289992)>>12; //-264
+ dst[i+VOFW]= (FFMIN(dst[i+VOFW],30775)*4663 - 9289992)>>12; //-264
}
}
}