Skip to content

Commit

Permalink
Fix sidedata copying
Browse files Browse the repository at this point in the history
Need to create a new side data entry and copy the data, instead of
preserving the original entry (which is owned by the incoming packet).
  • Loading branch information
Nevcairiel committed Feb 22, 2018
1 parent 70582f6 commit a28941e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion common/DSUtilLite/DShowUtil.cpp
Expand Up @@ -710,7 +710,8 @@ void CopyMediaSideDataFF(AVPacket *dst, const MediaSideDataFFMpeg **sd)

// add sidedata to the packet
for (int i = 0; i < (*sd)->side_data_elems; i++) {
av_packet_add_side_data(dst, (*sd)->side_data[i].type, (*sd)->side_data[i].data, (*sd)->side_data[i].size);
uint8_t *ptr = av_packet_new_side_data(dst, (*sd)->side_data[i].type, (*sd)->side_data[i].size);
memcpy(ptr, (*sd)->side_data[i].data, (*sd)->side_data[i].size);
}

*sd = nullptr;
Expand Down

0 comments on commit a28941e

Please sign in to comment.