Signed-off-by: Paul B Mahol <[email protected]>
---
 libavcodec/pnmenc.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c
index 843629e..261665a 100644
--- a/libavcodec/pnmenc.c
+++ b/libavcodec/pnmenc.c
@@ -72,6 +72,10 @@ static int pnm_encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
         n  = avctx->width * 6;
         break;
     case PIX_FMT_YUV420P:
+        if (avctx->width & 1) {
+            av_log(avctx, AV_LOG_ERROR, "pgmyuv needs even width\n");
+            return AVERROR(EINVAL);
+        }
         c  = '5';
         n  = avctx->width;
         h1 = (h * 3) / 2;
-- 
1.7.7

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to