aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2018-02-01 14:56:49 +0200
committerMartin Storsjö <martin@martin.st>2018-02-01 15:50:00 +0200
commit8965e2af921ec5926b26d5ae466ee4104bb5262b (patch)
tree01388b9f697a22a8a3f1afbb4fd7eee7d871dc1d
parent5085f25ace1e74846a0de3369bedd0e22d1a1bdc (diff)
downloadffmpeg-8965e2af921ec5926b26d5ae466ee4104bb5262b.tar.gz
avpacket: Initialize the allocated padding area in side data
This makes sure that consumers of the side data actually can rely on the padding as intended, without having the callers of av_packet_new_side_data to explicitly zero initialize it. Signed-off-by: Martin Storsjö <martin@martin.st>
-rw-r--r--libavcodec/avpacket.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/avpacket.c b/libavcodec/avpacket.c
index 93e9eb6ae7..c705df3d59 100644
--- a/libavcodec/avpacket.c
+++ b/libavcodec/avpacket.c
@@ -271,6 +271,7 @@ uint8_t *av_packet_new_side_data(AVPacket *pkt, enum AVPacketSideDataType type,
data = av_malloc(size + AV_INPUT_BUFFER_PADDING_SIZE);
if (!data)
return NULL;
+ memset(data + size, 0, AV_INPUT_BUFFER_PADDING_SIZE);
ret = av_packet_add_side_data(pkt, type, data, size);
if (ret < 0) {