v210enc: use stride as it is already calculated
authorPaul B Mahol <onemda@gmail.com>
Sun, 5 Feb 2012 21:14:38 +0000 (21:14 +0000)
committerAnton Khirnov <anton@khirnov.net>
Mon, 6 Feb 2012 07:00:23 +0000 (08:00 +0100)
Signed-off-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/v210enc.c

index 00a8902..17b3a9a 100644 (file)
@@ -62,7 +62,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf,
     uint8_t *p = buf;
     uint8_t *pdst = buf;
 
-    if (buf_size < aligned_width * avctx->height * 8 / 3) {
+    if (buf_size < avctx->height * stride) {
         av_log(avctx, AV_LOG_ERROR, "output buffer too small\n");
         return AVERROR(ENOMEM);
     }