ffmpeg: add the edge at the correct place in allocating of the buffer.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Apr 2012 21:13:06 +0000 (23:13 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sun, 29 Apr 2012 21:13:06 +0000 (23:13 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
ffmpeg.c

index 6efa12c..abceb3f 100644 (file)
--- 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);