diff mbox

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

Message ID 20191015014518.25746-1-andriy.gelman@gmail.com
State Accepted
Headers show

Commit Message

Andriy Gelman Oct. 15, 2019, 1:45 a.m. UTC
From: Andriy Gelman <andriy.gelman@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 mbox

Patch

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;