[FFmpeg-devel] [PATCH] avcodec/h2645_parse: Reset nal_buffer_size on uninit

Andriy Gelman andriy.gelman at gmail.com
Tue Oct 15 04:45:18 EEST 2019


From: Andriy Gelman <andriy.gelman at gmail.com>

Without reseting nal_buffer_size, av_fast_realloc will fail if
ff_h2645_packet_split is called with the unitialized pkt as argument.
---
 libavcodec/h2645_parse.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index b1dba3d510..d3d065f371 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -525,6 +525,7 @@ void ff_h2645_packet_uninit(H2645Packet *pkt)
     }
     av_freep(&pkt->nals);
     pkt->nals_allocated = 0;
+    pkt->nal_buffer_size = 0;
     if (pkt->rbsp.rbsp_buffer_ref) {
         av_buffer_unref(&pkt->rbsp.rbsp_buffer_ref);
         pkt->rbsp.rbsp_buffer = NULL;
-- 
2.23.0



More information about the ffmpeg-devel mailing list