mirror of https://git.ffmpeg.org/ffmpeg.git
avformat/seek: use av_malloc_array()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
d9ddbaa924
commit
a7bb22c5aa
|
@ -280,7 +280,7 @@ int64_t ff_gen_syncpoint_search(AVFormatContext *s,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initialize syncpoint structures for each stream.
|
// Initialize syncpoint structures for each stream.
|
||||||
sync = av_malloc(s->nb_streams * sizeof(AVSyncPoint));
|
sync = av_malloc_array(s->nb_streams, sizeof(AVSyncPoint));
|
||||||
if (!sync)
|
if (!sync)
|
||||||
// cannot allocate helper structure
|
// cannot allocate helper structure
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -402,7 +402,7 @@ AVParserState *ff_store_parser_state(AVFormatContext *s)
|
||||||
if (!state)
|
if (!state)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
state->stream_states = av_malloc(sizeof(AVParserStreamState) * s->nb_streams);
|
state->stream_states = av_malloc_array(s->nb_streams, sizeof(AVParserStreamState));
|
||||||
if (!state->stream_states) {
|
if (!state->stream_states) {
|
||||||
av_free(state);
|
av_free(state);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue