From: "Ronald S. Bultje" <[email protected]>

We accessed the alpha array even it wasn't used and didn't
exist, hence leading to a NULL pointer segfault.
---
 libswscale/swscale.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index 5071fea..29fd08d 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1147,7 +1147,8 @@ yuv2rgb_2_c_template(SwsContext *c, const int16_t *buf[2],
     const int16_t *buf0  = buf[0],  *buf1  = buf[1],
                   *ubuf0 = ubuf[0], *ubuf1 = ubuf[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 uvalpha1 = 4095 - uvalpha;
     int i;
-- 
1.7.5.4

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to