History

yuv4mpeg: fix potential alignment bug

Michael Niedermayer committed 14 years ago

Commit b86e18f1 parent 7beadfe1 file · +3 −2Browse files

Unified · Split

libavformat/yuv4mpeg.c+3−2
@@ -121,7 +121,7 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) · 120 unmodified lines
121121 {
122122 AVStream *st = s->streams[pkt->stream_index];
123123 AVIOContext *pb = s->pb;
124− AVPicture *picture;
124+ AVPicture *picture, picture_tmp;
125125 int* first_pkt = s->priv_data;
126126 int width, height, h_chroma_shift, v_chroma_shift;
127127 int i;
@@ -129,7 +129,8 @@ static int yuv4_write_packet(AVFormatContext *s, AVPacket *pkt) · 1 unmodified line
129129 char buf1[20];
130130 uint8_t *ptr, *ptr1, *ptr2;
131131
132− picture = (AVPicture *)pkt->data;
132+ memcpy(&picture_tmp, pkt->data, sizeof(AVPicture));
133+ picture = &picture_tmp;
133134
134135 /* for the first packet we have to output the header as well */
135136 if (*first_pkt) {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t