Skip to content

Commit

Permalink
avformat/ico: use avmalloc(z)_array()
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
  • Loading branch information
michaelni committed Apr 16, 2014
1 parent 11b36b1 commit dd77f64
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion libavformat/icodec.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int read_header(AVFormatContext *s)
avio_skip(pb, 4);
ico->nb_images = avio_rl16(pb);

ico->images = av_malloc(ico->nb_images * sizeof(IcoImage));
ico->images = av_malloc_array(ico->nb_images, sizeof(IcoImage));
if (!ico->images)
return AVERROR(ENOMEM);

Expand Down
2 changes: 1 addition & 1 deletion libavformat/icoenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static int ico_write_header(AVFormatContext *s)
avio_skip(pb, 16);
}

ico->images = av_mallocz(ico->nb_images * sizeof(IcoMuxContext));
ico->images = av_mallocz_array(ico->nb_images, sizeof(IcoMuxContext));
if (!ico->images)
return AVERROR(ENOMEM);

Expand Down

0 comments on commit dd77f64

Please sign in to comment.