From 7588b33ad4b33a52ed293c1e36ece496ba842291 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 29 Apr 2012 23:13:06 +0200 Subject: [PATCH] ffmpeg: add the edge at the correct place in allocating of the buffer. Signed-off-by: Michael Niedermayer --- ffmpeg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ffmpeg.c b/ffmpeg.c index 6efa12c4d9..abceb3f50e 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -546,12 +546,13 @@ static int alloc_buffer(InputStream *ist, AVCodecContext *s, FrameBuffer **pbuf) if (!buf) return AVERROR(ENOMEM); + avcodec_align_dimensions(s, &w, &h); + if (!(s->flags & CODEC_FLAG_EMU_EDGE)) { w += 2*edge; h += 2*edge; } - avcodec_align_dimensions(s, &w, &h); if ((ret = av_image_alloc(buf->base, buf->linesize, w, h, s->pix_fmt, 32)) < 0) { av_freep(&buf);