swscale/swscale_unscaled: fix alpha values for rgb/bgr -> RGB32_1 / BGR32_1

Found-by: Justin Ruggles
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-09-19 23:09:16 +02:00
parent 1225b67fc9
commit 13eff473ad

View File

@ -879,8 +879,13 @@ static int rgbToRgbWrapper(SwsContext *c, const uint8_t *src[], int srcStride[],
srcPtr += ALT32_CORR;
if ((dstFormat == AV_PIX_FMT_RGB32_1 || dstFormat == AV_PIX_FMT_BGR32_1) &&
!isRGBA32(srcFormat))
!isRGBA32(srcFormat)) {
int i;
av_assert0(ALT32_CORR == 1);
for (i = 0; i < srcSliceH; i++)
dstPtr[dstStride[0] * (srcSliceY + i)] = 255;
dstPtr += ALT32_CORR;
}
if (dstStride[0] * srcBpp == srcStride[0] * dstBpp && srcStride[0] > 0 &&
!(srcStride[0] % srcBpp) && !dst_bswap && !src_bswap)