[FFmpeg-cvslog] avcodec/svq3: Dont memcpy AVFrame

Michael Niedermayer git at videolan.org
Fri Nov 14 19:28:38 CET 2014


ffmpeg | branch: release/2.0 | Michael Niedermayer <michaelni at gmx.at> | Sat Oct  4 00:13:26 2014 +0200| [ff59edb6dcd7e695b28335c5f718fb7342823714] | committer: Michael Niedermayer

avcodec/svq3: Dont memcpy AVFrame

This avoids out of array accesses

Fixes: asan_heap-uaf_21f42e4_9_asan_heap-uaf_21f42e4_278_gl2.mov

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit 075a165d2715837d125a9cc714fb430ccf6c9d6b)

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/svq3.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c
index 3da341e..5e8e107 100644
--- a/libavcodec/svq3.c
+++ b/libavcodec/svq3.c
@@ -1147,7 +1147,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, void *data,
 
     h->cur_pic_ptr = s->cur_pic;
     av_frame_unref(&h->cur_pic.f);
-    h->cur_pic     = *s->cur_pic;
+    memcpy(&h->cur_pic.tf, &s->cur_pic->tf, sizeof(h->cur_pic) - offsetof(Picture, tf));
     ret = av_frame_ref(&h->cur_pic.f, &s->cur_pic->f);
     if (ret < 0)
         return ret;



More information about the ffmpeg-cvslog mailing list