summaryrefslogtreecommitdiff
path: root/libavcodec/pnmenc.c
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2012-10-24 18:38:31 +0000
committerPaul B Mahol <onemda@gmail.com>2012-10-24 18:38:31 +0000
commit6ddb03caf0029b72db3cc7e4fd362e76c0d92c87 (patch)
tree8e5647556b023b1c617fdb133d8356fbdd9cb28f /libavcodec/pnmenc.c
parente12cfd044c2bae4a099a3b9384b148424858d72b (diff)
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>
Diffstat (limited to 'libavcodec/pnmenc.c')
-rw-r--r--libavcodec/pnmenc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c
index e311b2ef75..ab20cf558f 100644
--- a/libavcodec/pnmenc.c
+++ b/libavcodec/pnmenc.c
@@ -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';