[FFmpeg-devel] [PATCH] avcodec/mov: Allocate skipped_bytes_pos with av_realloc.
Mark Wachsler
wachsler at google.com
Thu Aug 31 21:07:43 EEST 2017
Memory reallocated with av_reallocp_array is supposed to be allocated
with av_realloc, not av_malloc.
---
libavcodec/h2645_parse.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index b0d9ff66f0..1b2534b2e6 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -318,7 +318,8 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
nal = &pkt->nals[pkt->nb_nals];
nal->skipped_bytes_pos_size = 1024; // initial buffer size
- nal->skipped_bytes_pos = av_malloc_array(nal->skipped_bytes_pos_size, sizeof(*nal->skipped_bytes_pos));
+ nal->skipped_bytes_pos = av_realloc(NULL, nal->skipped_bytes_pos_size *
+ sizeof(*nal->skipped_bytes_pos));
if (!nal->skipped_bytes_pos)
return AVERROR(ENOMEM);
--
2.14.1.581.gf28d330327-goog
More information about the ffmpeg-devel
mailing list