[FFmpeg-cvslog] v410enc: fix output buffer size check

Mans Rullgard git at videolan.org
Fri Dec 16 01:32:13 CET 2011


ffmpeg | branch: master | Mans Rullgard <mans at mansr.com> | Thu Dec 15 16:31:07 2011 +0000| [dabba0c676389b73c7b324fc999da7076fae149e] | committer: Mans Rullgard

v410enc: fix output buffer size check

The encoder clearly needs width * height * 4 bytes.

Signed-off-by: Mans Rullgard <mans at mansr.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dabba0c676389b73c7b324fc999da7076fae149e
---

 libavcodec/v410enc.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavcodec/v410enc.c b/libavcodec/v410enc.c
index d15fb7a..95b36c1 100644
--- a/libavcodec/v410enc.c
+++ b/libavcodec/v410enc.c
@@ -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);
     }



More information about the ffmpeg-cvslog mailing list