diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-10-04 00:13:26 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-11-01 15:51:16 +0100 |
commit | e812a089f549797f60dcc0e3846089538d7e8cf7 (patch) | |
tree | 0f9951f6ae76a801ab7c3ebdefedd6e9e7a1ab70 | |
parent | 9b8b35910ffb312c4a9efcead6314ab003bacd83 (diff) | |
download | ffmpeg-e812a089f549797f60dcc0e3846089538d7e8cf7.tar.gz |
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@gmx.at>
(cherry picked from commit 075a165d2715837d125a9cc714fb430ccf6c9d6b)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/svq3.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index d3c5672d42..3fb5173ae2 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1168,7 +1168,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; |