v410enc: fix output buffer size check
authorMans Rullgard <mans@mansr.com>
Thu, 15 Dec 2011 16:31:07 +0000 (16:31 +0000)
committerMans Rullgard <mans@mansr.com>
Thu, 15 Dec 2011 17:47:10 +0000 (17:47 +0000)
The encoder clearly needs width * height * 4 bytes.

Signed-off-by: Mans Rullgard <mans@mansr.com>
libavcodec/v410enc.c

index d15fb7ab97c1d4b5696004a5c52d6f013236b031..95b36c138e984af281f819b72dc8aa7354f24cb6 100644 (file)
@@ -50,7 +50,7 @@ static int v410_encode_frame(AVCodecContext *avctx, uint8_t *buf,
     int i, j;
     int output_size = 0;
 
-    if (buf_size < avctx->width * avctx->height * 3) {
+    if (buf_size < avctx->width * avctx->height * 4) {
         av_log(avctx, AV_LOG_ERROR, "Out buffer is too small.\n");
         return AVERROR(ENOMEM);
     }