diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-05-05 18:22:37 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2025-05-15 01:51:34 +0200 |
commit | 0d7172a9ffd15577faebecedaabeff398f26ef40 (patch) | |
tree | a1b9f8a89c78637294b00dc7e3608cfa4074af70 | |
parent | f71d0f0559c2ff075057c5016ff57545b0864afd (diff) | |
download | ffmpeg-0d7172a9ffd15577faebecedaabeff398f26ef40.tar.gz |
avcodec/cbs: Avoid branch
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
-rw-r--r-- | libavcodec/cbs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libavcodec/cbs.c b/libavcodec/cbs.c index 2b4445ddb8..6b2ebe597d 100644 --- a/libavcodec/cbs.c +++ b/libavcodec/cbs.c @@ -783,15 +783,13 @@ static int cbs_insert_unit(CodedBitstreamFragment *frag, if (position < frag->nb_units) memcpy(units + position + 1, frag->units + position, (frag->nb_units - position) * sizeof(*units)); - } - - memset(units + position, 0, sizeof(*units)); - if (units != frag->units) { av_free(frag->units); frag->units = units; } + memset(units + position, 0, sizeof(*units)); + ++frag->nb_units; return 0; |