Merge commit '2cd4068071b9a8908823a3107f97e938211045ce'
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Feb 2013 14:21:39 +0000 (15:21 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 6 Feb 2013 14:21:39 +0000 (15:21 +0100)
* commit '2cd4068071b9a8908823a3107f97e938211045ce':
  fraps: fix off-by one bug for version 1.

Conflicts:
libavcodec/fraps.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
1  2 
cmdutils.c
libavcodec/fraps.c

diff --cc cmdutils.c
Simple merge
@@@ -247,12 -217,32 +247,10 @@@ static int decode_frame(AVCodecContext 
  
      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);
 -        if ((buf_size != avctx->width * avctx->height * 3 + header_size) &&
 -            (buf_size != header_size) ) {
 -            av_log(avctx, AV_LOG_ERROR,
 -                   "Invalid frame length %d (should be %d)\n",
 -                   buf_size, avctx->width * avctx->height * 3 + header_size);
 -            return AVERROR_INVALIDDATA;
 -        }
--
 -        f->reference = 1;
 -        f->buffer_hints = FF_BUFFER_HINTS_VALID |
 -                          FF_BUFFER_HINTS_PRESERVE |
 -                          FF_BUFFER_HINTS_REUSABLE;
 -        if ((ret = avctx->reget_buffer(avctx, f)) < 0) {
 -            av_log(avctx, AV_LOG_ERROR, "reget_buffer() failed\n");
 -            return ret;
 -        }
 -        /* bit 31 means same as previous pic */
 -        f->pict_type = (header & (1U<<31))? AV_PICTURE_TYPE_P : AV_PICTURE_TYPE_I;
 -        f->key_frame = f->pict_type == AV_PICTURE_TYPE_I;
--
 -        if (f->pict_type == AV_PICTURE_TYPE_I) {
+             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: