diff options
Diffstat (limited to 'libavcodec/xwddec.c')
-rw-r--r-- | libavcodec/xwddec.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libavcodec/xwddec.c b/libavcodec/xwddec.c index 8963c96380..c28e19fa8b 100644 --- a/libavcodec/xwddec.c +++ b/libavcodec/xwddec.c @@ -3,20 +3,20 @@ * * Copyright (c) 2012 Paul B Mahol * - * This file is part of Libav. + * This file is part of FFmpeg. * - * Libav is free software; you can redistribute it and/or + * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * - * Libav is distributed in the hope that it will be useful, + * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with Libav; if not, write to the Free Software + * License along with FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ @@ -141,7 +141,7 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, } if (pixformat != XWD_Z_PIXMAP) { - av_log(avctx, AV_LOG_ERROR, "pixmap format %d unsupported\n", pixformat); + avpriv_report_missing_feature(avctx, "Pixmap format %d", pixformat); return AVERROR_PATCHWELCOME; } @@ -149,10 +149,13 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, switch (vclass) { case XWD_STATIC_GRAY: case XWD_GRAY_SCALE: - if (bpp != 1) + if (bpp != 1 && bpp != 8) return AVERROR_INVALIDDATA; - if (pixdepth == 1) + if (pixdepth == 1) { avctx->pix_fmt = AV_PIX_FMT_MONOWHITE; + } else if (pixdepth == 8) { + avctx->pix_fmt = AV_PIX_FMT_GRAY8; + } break; case XWD_STATIC_COLOR: case XWD_PSEUDO_COLOR: @@ -198,10 +201,8 @@ static int xwd_decode_frame(AVCodecContext *avctx, void *data, return AVERROR_PATCHWELCOME; } - if ((ret = ff_get_buffer(avctx, p, 0)) < 0) { - av_log(avctx, AV_LOG_ERROR, "get_buffer() failed\n"); + if ((ret = ff_get_buffer(avctx, p, 0)) < 0) return ret; - } p->key_frame = 1; p->pict_type = AV_PICTURE_TYPE_I; |