Commit c051d668 authored by Paul B Mahol's avatar Paul B Mahol

avformat/avidec: use av_calloc() and check for allocation error

Signed-off-by: 's avatarPaul B Mahol <onemda@gmail.com>
parent 23637f98
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment