aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-09-04 04:09:59 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-09-04 13:42:53 +0200
commit4f63d6d3b5c064fe4671bd2d190ac13e18aee8a6 (patch)
treecb91b69f8e7abc8a8a687c445885537f3842064c
parentbb8b752553f88e6285e8e4c7e15853eed865dc28 (diff)
downloadffmpeg-4f63d6d3b5c064fe4671bd2d190ac13e18aee8a6.tar.gz
avdevice/x11grab: fix error handling in pixel formats
Reviewed-by: Benoit Fouet <benoit.fouet@free.fr> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavdevice/x11grab.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c
index 120f754b10..e0d1dfacfa 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",