mirror of
https://gitlab.com/mbunkus/mkvtoolnix.git
synced 2024-12-24 20:01:53 +00:00
Do not push_back entries after resize()ing the vector.
This commit is contained in:
parent
6b23fb887e
commit
38aafc76cf
@ -859,9 +859,9 @@ generic_packetizer_c::add_packet(memories_c &mems,
|
|||||||
mems[0]->release();
|
mems[0]->release();
|
||||||
for (i = 1; i < mems.size(); i++) {
|
for (i = 1; i < mems.size(); i++) {
|
||||||
add_length = mems[i]->size;
|
add_length = mems[i]->size;
|
||||||
pack->data_adds.push_back(compressor->compress(mems[i]->data,
|
pack->data_adds[i - 1] = compressor->compress(mems[i]->data,
|
||||||
add_length));
|
add_length);
|
||||||
pack->data_adds_lengths.push_back(add_length);
|
pack->data_adds_lengths[i - 1] = add_length;
|
||||||
mems[i]->release();
|
mems[i]->release();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -874,12 +874,12 @@ generic_packetizer_c::add_packet(memories_c &mems,
|
|||||||
for (i = 1; i < mems.size(); i++) {
|
for (i = 1; i < mems.size(); i++) {
|
||||||
if (!mems[i]->is_free) {
|
if (!mems[i]->is_free) {
|
||||||
add_length = mems[i]->size;
|
add_length = mems[i]->size;
|
||||||
pack->data_adds.push_back((unsigned char *)safememdup(mems[i]->data,
|
pack->data_adds[i - 1] = (unsigned char *)safememdup(mems[i]->data,
|
||||||
add_length));
|
add_length);
|
||||||
pack->data_adds_lengths.push_back(add_length);
|
pack->data_adds_lengths[i - 1] = add_length;
|
||||||
} else {
|
} else {
|
||||||
pack->data_adds.push_back(mems[i]->data);
|
pack->data_adds[i - 1] = mems[i]->data;
|
||||||
pack->data_adds_lengths.push_back(mems[i]->size);
|
pack->data_adds_lengths[i - 1] = mems[i]->size;
|
||||||
mems[i]->lock();
|
mems[i]->lock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user