Commit 6ddb03ca authored by Paul B Mahol's avatar Paul B Mahol

pgmyuvenc: do not create files which are not supported

It is possible to support files with odd width and/or height
if real width and height are stored in header.
Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent e12cfd04
......@@ -69,8 +69,8 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
n = avctx->width * 6;
break;
case AV_PIX_FMT_YUV420P:
if (avctx->width & 1) {
av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width\n");
if (avctx->width & 1 || avctx->height & 1) {
av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width and height\n");
return AVERROR(EINVAL);
}
c = '5';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment