summaryrefslogtreecommitdiff
path: root/libswscale/output.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-05-18 15:08:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-05-18 15:14:19 +0200
commite1efacf60bc8100d5075cf682f7d7a2f8f90f285 (patch)
tree95346d1f122cd84708c19973e016c8bab0cc1282 /libswscale/output.c
parentd91e44301c92ed6c6c4efc479a3e24437b5cebf3 (diff)
sws/output: yuv2rgb_write() assert that alpha has the correct value in the tables
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libswscale/output.c')
-rw-r--r--libswscale/output.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libswscale/output.c b/libswscale/output.c
index c9af23b67e..6aa3112ca0 100644
--- a/libswscale/output.c
+++ b/libswscale/output.c
@@ -1149,9 +1149,15 @@ yuv2rgb_write(uint8_t *_dest, int i, int Y1, int Y2,
if (hasAlpha) {
int sh = (target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24;
+ av_assert2((((r[Y1] + g[Y1] + b[Y1]) >> sh) & 0xFF) == 0);
dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1] + (A1 << sh);
dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2] + (A2 << sh);
} else {
+#if ASSERT_LEVEL > 1
+ int sh = (target == AV_PIX_FMT_RGB32_1 || target == AV_PIX_FMT_BGR32_1) ? 0 : 24;
+
+ av_assert2((((r[Y1] + g[Y1] + b[Y1]) >> sh) & 0xFF) == 0xFF);
+#endif
dest[i * 2 + 0] = r[Y1] + g[Y1] + b[Y1];
dest[i * 2 + 1] = r[Y2] + g[Y2] + b[Y2];
}