Commit 02dc2b5d authored by cehoyos's avatar cehoyos

Fix crash when trying to convert from or to RGBi (i<15) as in bgr8torgb24

git-svn-id: file:///var/local/repositories/mplayer/trunk/libswscale@22910 b3059339-0415-0410-9bf9-f77b7e298cf2
parent a1f3acd8
......@@ -2086,6 +2086,13 @@ SwsContext *sws_getContext(int srcW, int srcH, int srcFormat, int dstW, int dstH
/* rgb/bgr -> rgb/bgr (no dither needed forms) */
if( (isBGR(srcFormat) || isRGB(srcFormat))
&& (isBGR(dstFormat) || isRGB(dstFormat))
&& srcFormat != PIX_FMT_BGR8 && dstFormat != PIX_FMT_BGR8
&& srcFormat != PIX_FMT_RGB8 && dstFormat != PIX_FMT_RGB8
&& srcFormat != PIX_FMT_BGR4 && dstFormat != PIX_FMT_BGR4
&& srcFormat != PIX_FMT_RGB4 && dstFormat != PIX_FMT_RGB4
&& srcFormat != PIX_FMT_BGR4_BYTE && dstFormat != PIX_FMT_BGR4_BYTE
&& srcFormat != PIX_FMT_RGB4_BYTE && dstFormat != PIX_FMT_RGB4_BYTE
&& srcFormat != PIX_FMT_MONOBLACK && dstFormat != PIX_FMT_MONOBLACK
&& !needsDither)
c->swScale= rgb2rgbWrapper;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment