Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul B Mahol <onemda@gmail.com>2013-09-16 21:22:28 +0400
committerPaul B Mahol <onemda@gmail.com>2013-09-16 22:53:28 +0400
commitc051d668b5dbf040f92551f78b1b13635b8fcfb8 (patch)
tree297abcc6f1932cd30429ade4432233e08bccf361
parent23637f98f4a90a7f0413db57ddb01a4d1a82ead7 (diff)
avformat/avidec: use av_calloc() and check for allocation error
Signed-off-by: Paul B Mahol <onemda@gmail.com>
-rw-r--r--libavformat/avidec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index fab1168c22..ff20b7c0d8 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1487,7 +1487,9 @@ static int guess_ni_flag(AVFormatContext *s)
avio_seek(s->pb, oldpos, SEEK_SET);
if (last_start > first_end)
return 1;
- idx= av_mallocz(sizeof(*idx) * s->nb_streams);
+ idx= av_calloc(s->nb_streams, sizeof(*idx));
+ if (!idx)
+ return 0;
for (min_pos=pos=0; min_pos!=INT64_MAX; pos= min_pos+1LU) {
int64_t max_dts = INT64_MIN/2, min_dts= INT64_MAX/2;
min_pos = INT64_MAX;