1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

When copying pkt side_data, don't forget size, type

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Andrey Utkin 2012-09-17 19:55:02 +03:00 committed by Michael Niedermayer
parent 63951aec2b
commit b0fabed20f

View File

@ -144,9 +144,12 @@ int av_dup_packet(AVPacket *pkt)
pkt->side_data_elems * sizeof(*pkt->side_data), 0); pkt->side_data_elems * sizeof(*pkt->side_data), 0);
memset(pkt->side_data, 0, memset(pkt->side_data, 0,
pkt->side_data_elems * sizeof(*pkt->side_data)); pkt->side_data_elems * sizeof(*pkt->side_data));
for (i = 0; i < pkt->side_data_elems; i++) for (i = 0; i < pkt->side_data_elems; i++) {
DUP_DATA(pkt->side_data[i].data, tmp_pkt.side_data[i].data, DUP_DATA(pkt->side_data[i].data, tmp_pkt.side_data[i].data,
tmp_pkt.side_data[i].size, 1); tmp_pkt.side_data[i].size, 1);
pkt->side_data[i].size = tmp_pkt.side_data[i].size;
pkt->side_data[i].type = tmp_pkt.side_data[i].type;
}
} }
} }
return 0; return 0;