[FFmpeg-cvslog] ffserver: Use av_malloc_array()

Michael Niedermayer git at videolan.org
Sat Jan 10 00:25:07 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Jan  6 17:55:50 2015 +0100| [11d8fa5e9d695fc3f9f553dc313edd9d4e45ed18] | committer: Michael Niedermayer

ffserver: Use av_malloc_array()

Reviewed-by: "Reynaldo H. Verdejo Pinochet" <reynaldo at osg.samsung.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 ffserver.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/ffserver.c b/ffserver.c
index 1f20d19..0b69196 100644
--- a/ffserver.c
+++ b/ffserver.c
@@ -2810,11 +2810,9 @@ static int prepare_sdp_description(FFServerStream *stream, uint8_t **pbuffer,
         snprintf(avc->filename, 1024, "rtp://0.0.0.0");
     }
 
-    if (avc->nb_streams >= INT_MAX/sizeof(*avc->streams) ||
-        !(avc->streams = av_malloc(avc->nb_streams * sizeof(*avc->streams))))
+    if (!(avc->streams = av_malloc_array(avc->nb_streams, sizeof(*avc->streams))))
         goto sdp_done;
-    if (avc->nb_streams >= INT_MAX/sizeof(*avs) ||
-        !(avs = av_malloc(avc->nb_streams * sizeof(*avs))))
+    if (!(avs = av_malloc_array(avc->nb_streams, sizeof(*avs))))
         goto sdp_done;
 
     for(i = 0; i < stream->nb_streams; i++) {



More information about the ffmpeg-cvslog mailing list