aboutsummaryrefslogtreecommitdiffstats
path: root/libavdevice/v4l2.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-22 15:08:12 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-22 15:08:12 +0200
commit124c94a1c8dec7f2ba8c7a4a253bdb01cc494917 (patch)
treee2d14a8521522b31e39dc60641eb35cef114dbd2 /libavdevice/v4l2.c
parentaca48725afe8e8e3a6f7df06d088bd7bd8bd6dc6 (diff)
downloadffmpeg-124c94a1c8dec7f2ba8c7a4a253bdb01cc494917.tar.gz
avdevice/v4l2: Use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavdevice/v4l2.c')
-rw-r--r--libavdevice/v4l2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
index bbd4892cde..64df0c7950 100644
--- a/libavdevice/v4l2.c
+++ b/libavdevice/v4l2.c
@@ -351,12 +351,12 @@ static int mmap_init(AVFormatContext *ctx)
return AVERROR(ENOMEM);
}
s->buffers = req.count;
- s->buf_start = av_malloc(sizeof(void *) * s->buffers);
+ s->buf_start = av_malloc_array(s->buffers, sizeof(void *));
if (s->buf_start == NULL) {
av_log(ctx, AV_LOG_ERROR, "Cannot allocate buffer pointers\n");
return AVERROR(ENOMEM);
}
- s->buf_len = av_malloc(sizeof(unsigned int) * s->buffers);
+ s->buf_len = av_malloc_array(s->buffers, sizeof(unsigned int));
if (s->buf_len == NULL) {
av_log(ctx, AV_LOG_ERROR, "Cannot allocate buffer sizes\n");
av_free(s->buf_start);