Revision 68bed67d libavcodec/pngdec.c

View differences:

libavcodec/pngdec.c
467 467
                } else if (s->bit_depth == 16 &&
468 468
                           s->color_type == PNG_COLOR_TYPE_RGB) {
469 469
                    avctx->pix_fmt = PIX_FMT_RGB48BE;
470
                } else if (s->bit_depth == 1 &&
471
                           s->color_type == PNG_COLOR_TYPE_GRAY) {
470
                } else if (s->bit_depth == 1) {
472 471
                    avctx->pix_fmt = PIX_FMT_MONOBLACK;
473 472
                } else if (s->color_type == PNG_COLOR_TYPE_PALETTE) {
474 473
                    avctx->pix_fmt = PIX_FMT_PAL8;
......
504 503
                s->image_buf = p->data[0];
505 504
                s->image_linesize = p->linesize[0];
506 505
                /* copy the palette if needed */
507
                if (s->color_type == PNG_COLOR_TYPE_PALETTE)
506
                if (avctx->pix_fmt == PIX_FMT_PAL8)
508 507
                    memcpy(p->data[1], s->palette, 256 * sizeof(uint32_t));
509 508
                /* empty row is used if differencing to the first row */
510 509
                s->last_row = av_mallocz(s->row_size);

Also available in: Unified diff