aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/yuv4mpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-09-08 13:37:35 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-09-08 13:37:35 +0200
commitb86e18fe4626459de3a6d9ee1068411dcec7dc4e (patch)
tree0da632454206b6b19081b9cba9c00ab7be5c79a0 /libavformat/yuv4mpeg.c
parent7beadfe1f7777574e99fd4cf6bcd7abad4fb4089 (diff)
downloadffmpeg-b86e18fe4626459de3a6d9ee1068411dcec7dc4e.tar.gz
yuv4mpeg: fix potential alignment bug
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/yuv4mpeg.c')
-rw-r--r--libavformat/yuv4mpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index 5b6d2df282..a53d30fb37 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -121,7 +121,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st = s->streams[pkt->stream_index];
AVIOContext *pb = s->pb;
- AVPicture *picture;
+ AVPicture *picture, picture_tmp;
int* first_pkt = s->priv_data;
int width, height, h_chroma_shift, v_chroma_shift;
int i;
@@ -129,7 +129,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt)
char buf1[20];
uint8_t *ptr, *ptr1, *ptr2;
- picture = (AVPicture *)pkt->data;
+ memcpy(&picture_tmp, pkt->data, sizeof(AVPicture));
+ picture = &picture_tmp;
/* for the first packet we have to output the header as well */
if (*first_pkt) {