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

Andriy Gelman git at videolan.org
Tue Oct 15 06:05:50 EEST 2019


ffmpeg | branch: master | Andriy Gelman <andriy.gelman at gmail.com> | Mon Oct 14 21:45:18 2019 -0400| [cebb446911fdc6c42d5a480b441b025c399e4a88] | committer: James Almer

avcodec/h2645_parse: Reset nal_buffer_size on uninit

Without reseting nal_buffer_size, av_fast_realloc will fail if
ff_h2645_packet_split is called with the unitialized pkt as argument.

Signed-off-by: James Almer <jamrial at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=cebb446911fdc6c42d5a480b441b025c399e4a88
---

 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 b1dba3d510..4808f79a67 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -524,7 +524,7 @@ void ff_h2645_packet_uninit(H2645Packet *pkt)
         av_freep(&pkt->nals[i].skipped_bytes_pos);
     }
     av_freep(&pkt->nals);
-    pkt->nals_allocated = 0;
+    pkt->nals_allocated = pkt->nal_buffer_size = 0;
     if (pkt->rbsp.rbsp_buffer_ref) {
         av_buffer_unref(&pkt->rbsp.rbsp_buffer_ref);
         pkt->rbsp.rbsp_buffer = NULL;



More information about the ffmpeg-cvslog mailing list