From 7800b09ece52490dda4c46fbd8e93f92e8438428 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Tue, 11 Jun 2013 01:04:49 +0200 Subject: [PATCH] Check more completely for invalid pix_fmts in planarRgb16ToRgb16Wrapper() This makes the conversion function more robust. --- libswscale/swscale_unscaled.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libswscale/swscale_unscaled.c b/libswscale/swscale_unscaled.c index 774c655628..3b07800d02 100644 --- a/libswscale/swscale_unscaled.c +++ b/libswscale/swscale_unscaled.c @@ -495,7 +495,8 @@ static int planarRgb16ToRgb16Wrapper(SwsContext *c, const uint8_t *src[], swap += 2; if ((src_format->flags & (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) != - (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB)) { + (AV_PIX_FMT_FLAG_PLANAR | AV_PIX_FMT_FLAG_RGB) || + bits_per_sample <= 8) { av_log(c, AV_LOG_ERROR, "unsupported planar RGB conversion %s -> %s\n", src_format->name, dst_format->name); return srcSliceH;