Message ID | 1590847832-10236-1-git-send-email-lance.lmwang@gmail.com |
---|---|
State | Accepted |
Commit | 4bc5eb27a74e3eb1805f21a33d4ef08f8f7026e4 |
Headers | show |
Series | [FFmpeg-devel,v2] avutil/dict: av_realloc -> av_realloc_array() | expand |
Context | Check | Description |
---|---|---|
andriy/default | pending | |
andriy/make | success | Make finished |
andriy/make_fate | success | Make fate finished |
On Sat, May 30, 2020 at 10:10:32PM +0800, lance.lmwang@gmail.com wrote: > From: Limin Wang <lance.lmwang@gmail.com> > > Signed-off-by: Limin Wang <lance.lmwang@gmail.com> > --- > libavutil/dict.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/libavutil/dict.c b/libavutil/dict.c > index 0ea7138..9d3d96c 100644 > --- a/libavutil/dict.c > +++ b/libavutil/dict.c > @@ -103,8 +103,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, > av_free(tag->key); > *tag = m->elems[--m->count]; > } else if (copy_value) { > - AVDictionaryEntry *tmp = av_realloc(m->elems, > - (m->count + 1) * sizeof(*m->elems)); > + AVDictionaryEntry *tmp = av_realloc_array(m->elems, > + m->count + 1, sizeof(*m->elems)); > if (!tmp) > goto err_out; > m->elems = tmp; > -- > 1.8.3.1 > will apply it tomorrow if no further comments.
diff --git a/libavutil/dict.c b/libavutil/dict.c index 0ea7138..9d3d96c 100644 --- a/libavutil/dict.c +++ b/libavutil/dict.c @@ -103,8 +103,8 @@ int av_dict_set(AVDictionary **pm, const char *key, const char *value, av_free(tag->key); *tag = m->elems[--m->count]; } else if (copy_value) { - AVDictionaryEntry *tmp = av_realloc(m->elems, - (m->count + 1) * sizeof(*m->elems)); + AVDictionaryEntry *tmp = av_realloc_array(m->elems, + m->count + 1, sizeof(*m->elems)); if (!tmp) goto err_out; m->elems = tmp;