Showing the changes to libavcodec (1 of 1 file). Show all
Unified · Split
| @@ -783,15 +783,13 @@ static int cbs_insert_unit(CodedBitstreamFragment *frag, · 782 unmodified lines | |||
| 783 | if (position < frag->nb_units) | 783 | if (position < frag->nb_units) |
| 784 | memcpy(units + position + 1, frag->units + position, | 784 | memcpy(units + position + 1, frag->units + position, |
| 785 | (frag->nb_units - position) * sizeof(*units)); | 785 | (frag->nb_units - position) * sizeof(*units)); |
| 786 | } | ||
| 787 | |||
| 788 | memset(units + position, 0, sizeof(*units)); | ||
| 789 | 786 | ||
| 790 | if (units != frag->units) { | ||
| 791 | av_free(frag->units); | 787 | av_free(frag->units); |
| 792 | frag->units = units; | 788 | frag->units = units; |
| 793 | } | 789 | } |
| 794 | 790 | ||
| 791 | memset(units + position, 0, sizeof(*units)); | ||
| 792 | |||
| 795 | ++frag->nb_units; | 793 | ++frag->nb_units; |
| 796 | 794 | ||
| 797 | return 0; | 795 | return 0; |