[FFmpeg-cvslog] avformat/segment: Use av_malloc_array()

Michael Niedermayer git at videolan.org
Mon May 5 23:41:36 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon May  5 23:11:04 2014 +0200| [1394e0a9e03ea59a19668cd152b7dd1ca3aa880e] | committer: Michael Niedermayer

avformat/segment: Use av_malloc_array()

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1394e0a9e03ea59a19668cd152b7dd1ca3aa880e
---

 libavformat/segment.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/segment.c b/libavformat/segment.c
index ae27a95..fe84f27 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -373,7 +373,7 @@ static int parse_times(void *log_ctx, int64_t **times, int *nb_times,
         if (*p == ',')
             (*nb_times)++;
 
-    *times = av_malloc(sizeof(**times) * *nb_times);
+    *times = av_malloc_array(*nb_times, sizeof(**times));
     if (!*times) {
         av_log(log_ctx, AV_LOG_ERROR, "Could not allocate forced times array\n");
         FAIL(AVERROR(ENOMEM));
@@ -431,7 +431,7 @@ static int parse_frames(void *log_ctx, int **frames, int *nb_frames,
         if (*p == ',')
             (*nb_frames)++;
 
-    *frames = av_malloc(sizeof(**frames) * *nb_frames);
+    *frames = av_malloc_array(*nb_frames, sizeof(**frames));
     if (!*frames) {
         av_log(log_ctx, AV_LOG_ERROR, "Could not allocate forced frames array\n");
         FAIL(AVERROR(ENOMEM));



More information about the ffmpeg-cvslog mailing list