summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-02-06 15:21:39 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-02-06 15:21:39 +0100
commita845ac78c9428d6fd0f9f4f61a34ac816e3dedfa (patch)
tree071d4b4757b5b9abcfe05857f7e9c50aee88b43a
parentddc3ca2caa4a78f0e6824d0d19bc98cfd955b333 (diff)
parent2cd4068071b9a8908823a3107f97e938211045ce (diff)
Merge commit '2cd4068071b9a8908823a3107f97e938211045ce'
* commit '2cd4068071b9a8908823a3107f97e938211045ce': fraps: fix off-by one bug for version 1. Conflicts: libavcodec/fraps.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--cmdutils.c2
-rw-r--r--libavcodec/fraps.c10
-rw-r--r--tests/ref/fate/fraps-v12
3 files changed, 6 insertions, 8 deletions
diff --git a/cmdutils.c b/cmdutils.c
index 1357882055..29a23d7e4f 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -1856,7 +1856,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 cc2f52b609..5e2ba90d3f 100644
--- a/libavcodec/fraps.c
+++ b/libavcodec/fraps.c
@@ -247,12 +247,10 @@ static int decode_frame(AVCodecContext *avctx,
case 1:
/* Fraps v1 is an upside-down BGR24 */
- for (y=0; y<avctx->height; y++)
- memcpy(&f->data[0][(avctx->height - y) * f->linesize[0]],
- &buf[y * avctx->width * 3],
- 3 * avctx->width);
-
-
+ for (y = 0; y<avctx->height; y++)
+ memcpy(&f->data[0][(avctx->height - y - 1) * f->linesize[0]],
+ &buf[y * avctx->width * 3],
+ 3 * avctx->width);
break;
case 2:
diff --git a/tests/ref/fate/fraps-v1 b/tests/ref/fate/fraps-v1
index 64392c33b4..29c7e37df3 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