Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRonald S. Bultje <rsbultje@gmail.com>2011-07-08 23:28:28 +0400
committerRonald S. Bultje <rsbultje@gmail.com>2011-07-09 02:15:30 +0400
commitbf2cba453244a74331238a472fe0e309f116f4d9 (patch)
treeafecdcfcb5b40a0efaab072591497ff3701e4dc1 /libswscale/swscale.c
parentf44d50a94c120135faeba6b4a1e5551b4397810f (diff)
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.
Diffstat (limited to 'libswscale/swscale.c')
-rw-r--r--libswscale/swscale.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libswscale/swscale.c b/libswscale/swscale.c
index a302373b85..527dd80e0c 100644
--- a/libswscale/swscale.c
+++ b/libswscale/swscale.c
@@ -1136,7 +1136,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;