swscale/output: fix null pointer dereference in yuv2ya8_2_c()
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Jul 2015 21:03:25 +0000 (23:03 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Fri, 3 Jul 2015 21:03:25 +0000 (23:03 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswscale/output.c

index 09e3369..582eb5b 100644 (file)
@@ -1949,7 +1949,7 @@ yuv2ya8_2_c(SwsContext *c, const int16_t *buf[2],
             const int16_t *abuf[2], uint8_t *dest, int dstW,
             int yalpha, int uvalpha, int y)
 {
-    int hasAlpha = abuf[0] && abuf[1];
+    int hasAlpha = abuf && abuf[0] && abuf[1];
     const int16_t *buf0  = buf[0],  *buf1  = buf[1],
                   *abuf0 = hasAlpha ? abuf[0] : NULL,
                   *abuf1 = hasAlpha ? abuf[1] : NULL;