Revision 00182190 libavcodec/pnm.c

View differences:

libavcodec/pnm.c
138 138
                avctx->pix_fmt = PIX_FMT_GRAY16BE;
139 139
                if (s->maxval != 65535)
140 140
                    avctx->pix_fmt = PIX_FMT_GRAY16;
141
            } if (avctx->pix_fmt == PIX_FMT_RGB24) {
142
                if (s->maxval > 255)
143
                    avctx->pix_fmt = PIX_FMT_RGB48BE;
141 144
            } else {
142
                av_log(avctx, AV_LOG_ERROR, "16-bit components are only supported for grayscale\n");
145
                av_log(avctx, AV_LOG_ERROR, "Unsupported pixel format\n");
143 146
                avctx->pix_fmt = PIX_FMT_NONE;
144 147
                return -1;
145 148
            }

Also available in: Unified diff