[FFmpeg-cvslog] avdevice/x11grab: fix error handling in pixel formats

Michael Niedermayer git at videolan.org
Thu Sep 4 13:51:05 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep  4 04:09:59 2014 +0200| [4f63d6d3b5c064fe4671bd2d190ac13e18aee8a6] | committer: Michael Niedermayer

avdevice/x11grab: fix error handling in pixel formats

Reviewed-by: Benoit Fouet <benoit.fouet at free.fr>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavdevice/x11grab.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 120f754..e0d1dfa 100644
--- a/libavdevice/x11grab.c
+++ b/libavdevice/x11grab.c
@@ -181,6 +181,8 @@ static int pixfmt_from_image(AVFormatContext *s, XImage *image, int *pix_fmt)
            image->blue_mask,
            image->bits_per_pixel);
 
+    *pix_fmt = AV_PIX_FMT_NONE;
+
     switch (image->bits_per_pixel) {
     case 8:
         *pix_fmt =  AV_PIX_FMT_PAL8;
@@ -214,7 +216,8 @@ static int pixfmt_from_image(AVFormatContext *s, XImage *image, int *pix_fmt)
             *pix_fmt = AV_PIX_FMT_0RGB32;
         }
         break;
-    default:
+    }
+    if (*pix_fmt == AV_PIX_FMT_NONE) {
         av_log(s, AV_LOG_ERROR,
                "XImages with RGB mask 0x%.6lx 0x%.6lx 0x%.6lx and depth %i "
                "are currently not supported.\n",



More information about the ffmpeg-cvslog mailing list