avcodec/h2645_parse: simplify memset call
authorAndriy Gelman <andriy.gelman@gmail.com>
Sat, 7 Sep 2019 19:55:51 +0000 (15:55 -0400)
committerJames Almer <jamrial@gmail.com>
Wed, 11 Sep 2019 13:23:26 +0000 (10:23 -0300)
Removed (new_size - pkt->nals_allocated) because this value is always 1
during the call.

Signed-off-by: James Almer <jamrial@gmail.com>
libavcodec/h2645_parse.c

index 307e864..ef6a6b4 100644 (file)
@@ -461,8 +461,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
                 return AVERROR(ENOMEM);
 
             pkt->nals = tmp;
-            memset(pkt->nals + pkt->nals_allocated, 0,
-                   (new_size - pkt->nals_allocated) * sizeof(*pkt->nals));
+            memset(pkt->nals + pkt->nals_allocated, 0, sizeof(*pkt->nals));
 
             nal = &pkt->nals[pkt->nb_nals];
             nal->skipped_bytes_pos_size = 1024; // initial buffer size