[FFmpeg-devel] [PATCH v1] avcodec/h2645_parse: fix for the realloc size

lance.lmwang at gmail.com lance.lmwang at gmail.com
Tue Sep 10 04:18:44 EEST 2019


From: Limin Wang <lance.lmwang at gmail.com>

Signed-off-by: Limin Wang <lance.lmwang at gmail.com>
---
 libavcodec/h2645_parse.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 307e8643e6..403acd2ee1 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -454,7 +454,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
         }
 
         if (pkt->nals_allocated < pkt->nb_nals + 1) {
-            int new_size = pkt->nals_allocated + 1;
+            int new_size = pkt->nb_nals + 1;
             void *tmp = av_realloc_array(pkt->nals, new_size, sizeof(*pkt->nals));
 
             if (!tmp)
-- 
2.21.0



More information about the ffmpeg-devel mailing list