[FFmpeg-cvslog] fraps: fix off-by one bug for version 1.

Anton Khirnov git at videolan.org
Wed Feb 6 15:26:05 CET 2013


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Tue Jan 29 17:19:08 2013 +0100| [2cd4068071b9a8908823a3107f97e938211045ce] | committer: Anton Khirnov

fraps: fix off-by one bug for version 1.

CC:libav-stable at libav.org

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

 cmdutils.c              |    2 +-
 libavcodec/fraps.c      |    2 +-
 tests/ref/fate/fraps-v1 |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index dbe22e3..a9523ae 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1566,7 +1566,7 @@ static int alloc_buffer(FrameBuffer **pool, AVCodecContext *s, FrameBuffer **pbu
     /* XXX this shouldn't be needed, but some tests break without this line
      * those decoders are buggy and need to be fixed.
      * the following tests fail:
-     * fraps-v1, qtrle-1bit
+     * qtrle-1bit
      */
     memset(buf->base[0], 128, ret);
 
diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c
index 5473bd8..237cb74 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -239,7 +239,7 @@ static int decode_frame(AVCodecContext *avctx,
 
         if (f->pict_type == AV_PICTURE_TYPE_I) {
             for (y = 0; y<avctx->height; y++)
-                memcpy(&f->data[0][(avctx->height - y) * f->linesize[0]],
+                memcpy(&f->data[0][(avctx->height - y - 1) * f->linesize[0]],
                        &buf[y * avctx->width * 3],
                        3 * avctx->width);
         }
diff --git a/tests/ref/fate/fraps-v1 b/tests/ref/fate/fraps-v1
index 64392c3..29c7e37 100644
--- a/tests/ref/fate/fraps-v1
+++ b/tests/ref/fate/fraps-v1
@@ -1,2 +1,2 @@
 #tb 0: 1/25
-0,          0,          0,        1,   230400, 0x6bc891ff
+0,          0,          0,        1,   230400, 0x23c29d17



More information about the ffmpeg-cvslog mailing list