avcodec/av1_parse: simplify memset call
authorJames Almer <jamrial@gmail.com>
Tue, 15 Oct 2019 02:43:08 +0000 (23:43 -0300)
committerJames Almer <jamrial@gmail.com>
Tue, 15 Oct 2019 03:00:02 +0000 (00:00 -0300)
Removed (new_size - pkt->nals_allocated) because this value is always 1
during the call.
Based on commit 78b86c30d3860135042505dd4a9cbd95c4e6257d.

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

index cdd524b..6742bc1 100644 (file)
@@ -71,8 +71,7 @@ int ff_av1_packet_split(AV1Packet *pkt, const uint8_t *buf, int length, void *lo
                 return AVERROR(ENOMEM);
 
             pkt->obus = tmp;
-            memset(pkt->obus + pkt->obus_allocated, 0,
-                   (new_size - pkt->obus_allocated) * sizeof(*tmp));
+            memset(pkt->obus + pkt->obus_allocated, 0, sizeof(*pkt->obus));
             pkt->obus_allocated = new_size;
         }
         obu = &pkt->obus[pkt->nb_obus];