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

Michael Niedermayer michaelni at gmx.at
Thu Sep 4 13:43:30 CEST 2014


On Thu, Sep 04, 2014 at 10:27:34AM +0200, Benoit Fouet wrote:
> Hi,
> 
> ----- Mail original -----
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  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",
> 
> LGTM

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Asymptotically faster algorithms should always be preferred if you have
asymptotical amounts of data
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140904/3d66010d/attachment.asc>


More information about the ffmpeg-devel mailing list