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

Originally committed as revision 22910 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
Carl Eugen Hoyos 2007-04-03 16:22:19 +00:00
parent 12631f2dd0
commit 94bd08b069
1 changed files with 7 additions and 0 deletions

View File

@ -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;