avcodec/svq1enc: fix frame rotation code
authorMichael Niedermayer <michaelni@gmx.at>
Thu, 4 Jul 2013 20:21:27 +0000 (22:21 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Thu, 4 Jul 2013 20:22:04 +0000 (22:22 +0200)
Fixes Ticket2747

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/svq1enc.c

index afef854..5b4748f 100644 (file)
@@ -557,9 +557,9 @@ static int svq1_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
         s->scratchbuf = av_malloc(s->current_picture.linesize[0] * 16 * 2);
     }
 
-    temp               = s->current_picture;
-    s->current_picture = s->last_picture;
-    s->last_picture    = temp;
+    av_frame_move_ref(&temp, &s->current_picture);
+    av_frame_move_ref(&s->current_picture, &s->last_picture);
+    av_frame_move_ref(&s->last_picture, &temp);
 
     init_put_bits(&s->pb, pkt->data, pkt->size);