From 9cbb3fce5965f4e1423cace3d1dc340a7a8091f4 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Wed, 4 Sep 2013 21:00:24 +0200 Subject: [PATCH] avcodec/avpacket: zero memory in av_packet_new_side_data() This ensures that no uninitialized bytes cause non-deterministic behavior. Signed-off-by: Michael Niedermayer --- libavcodec/avpacket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c index 3469647277..b388d5e7bd 100644 --- a/libavcodec/avpacket.c +++ b/libavcodec/avpacket.c @@ -309,7 +309,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type, if (!pkt->side_data) return NULL; - pkt->side_data[elems].data = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE); + pkt->side_data[elems].data = av_mallocz(size + FF_INPUT_BUFFER_PADDING_SIZE); if (!pkt->side_data[elems].data) return NULL; pkt->side_data[elems].size = size;