[FFmpeg-cvslog] Check more completely for invalid pix_fmts in planarRgb16ToRgb16Wrapper()

Carl Eugen Hoyos git at videolan.org
Tue Jun 11 02:53:50 CEST 2013


ffmpeg | branch: master | Carl Eugen Hoyos <cehoyos at ag.or.at> | Tue Jun 11 01:04:49 2013 +0200| [7800b09ece52490dda4c46fbd8e93f92e8438428] | committer: Carl Eugen Hoyos

Check more completely for invalid pix_fmts in planarRgb16ToRgb16Wrapper()

This makes the conversion function more robust.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7800b09ece52490dda4c46fbd8e93f92e8438428
---

 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 774c655..3b07800 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;



More information about the ffmpeg-cvslog mailing list