1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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: Paul B Mahol <onemda@gmail.com>
This commit is contained in:
Paul B Mahol 2012-10-24 18:38:31 +00:00
parent e12cfd044c
commit 6ddb03caf0

View File

@ -69,8 +69,8 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
n = avctx->width * 6; n = avctx->width * 6;
break; break;
case AV_PIX_FMT_YUV420P: case AV_PIX_FMT_YUV420P:
if (avctx->width & 1) { if (avctx->width & 1 || avctx->height & 1) {
av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width\n"); av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width and height\n");
return AVERROR(EINVAL); return AVERROR(EINVAL);
} }
c = '5'; c = '5';