Commit 71a04bc1 authored by Ronald S. Bultje's avatar Ronald S. Bultje Committed by Michael Niedermayer

swscale: fix crash in 8-bpc bilinear output without alpha.

We accessed the alpha array even it wasn't used and didn't
exist, hence leading to a NULL pointer segfault.
(cherry picked from commit bf2cba45)
parent ac9ac45a
...@@ -1247,7 +1247,8 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2], ...@@ -1247,7 +1247,8 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
const int16_t *buf0 = buf[0], *buf1 = buf[1], const int16_t *buf0 = buf[0], *buf1 = buf[1],
*ubuf0 = ubuf[0], *ubuf1 = ubuf[1], *ubuf0 = ubuf[0], *ubuf1 = ubuf[1],
*vbuf0 = vbuf[0], *vbuf1 = vbuf[1], *vbuf0 = vbuf[0], *vbuf1 = vbuf[1],
*abuf0 = abuf[0], *abuf1 = abuf[1]; *abuf0 = hasAlpha ? abuf[0] : NULL,
*abuf1 = hasAlpha ? abuf[1] : NULL;
int yalpha1 = 4095 - yalpha; int yalpha1 = 4095 - yalpha;
int uvalpha1 = 4095 - uvalpha; int uvalpha1 = 4095 - uvalpha;
int i; int i;
......
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