pgmyuvenc: abort encoding if width is not even

Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Paul B Mahol 2012-03-18 18:04:44 +00:00 committed by Michael Niedermayer
parent eb74e9ea10
commit a41340f8e8

View File

@ -71,6 +71,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;