aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2022-11-27 11:22:44 +0100
committerAnton Khirnov <anton@khirnov.net>2023-01-04 11:48:17 +0100
commita4a81be1a877a829e332d1a3dc84999c1dddf7c1 (patch)
tree05194135ec991e9a3907e9cf30bc7d2e97eb2d13 /libavcodec
parent141303f3231d469c5f80bdb9c21ade27f4d9c618 (diff)
downloadffmpeg-a4a81be1a877a829e332d1a3dc84999c1dddf7c1.tar.gz
lavc/libx264: zero reordered opaque on alloc
This is safer.
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/libx264.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c
index e8ca3d896b..a1b044d4e9 100644
--- a/libavcodec/libx264.c
+++ b/libavcodec/libx264.c
@@ -1105,8 +1105,8 @@ static av_cold int X264_init(AVCodecContext *avctx)
// Overestimate the reordered opaque buffer size, in case a runtime
// reconfigure would increase the delay (which it shouldn't).
x4->nb_reordered_opaque = x264_encoder_maximum_delayed_frames(x4->enc) + 17;
- x4->reordered_opaque = av_malloc_array(x4->nb_reordered_opaque,
- sizeof(*x4->reordered_opaque));
+ x4->reordered_opaque = av_calloc(x4->nb_reordered_opaque,
+ sizeof(*x4->reordered_opaque));
if (!x4->reordered_opaque)
return AVERROR(ENOMEM);