On Mon, Sep 02, 2013 at 08:16:15PM +0200, Alexandra Khirnova wrote:
> --- a/libavformat/asfenc.c
> +++ b/libavformat/asfenc.c
> @@ -784,14 +784,17 @@ static int asf_write_packet(AVFormatContext *s,
> AVPacket *pkt)
> for (i = asf->nb_index_count; i < start_sec; i++) {
> if (i >= asf->nb_index_memory_alloc) {
> asf->nb_index_memory_alloc += ASF_INDEX_BLOCK;
> - asf->index_ptr = (ASFIndex
> *)av_realloc(asf->index_ptr,
> -
> sizeof(ASFIndex) *
> -
> asf->nb_index_memory_alloc);
> + if ((err = av_reallocp_array(&asf->index_ptr,
> asf->nb_index_memory_alloc,
> + sizeof(ASFIndex))) < 0) {
Keep lines below 80 characters where easily possible.
Use sizeof(*pointer) instead of sizeof(type).
same below
> --- a/libavformat/gxfenc.c
> +++ b/libavformat/gxfenc.c
> @@ -872,12 +873,13 @@ static int gxf_write_packet(AVFormatContext *s,
> AVPacket *pkt)
> + if ((err = av_reallocp_array(&gxf->flt_entries,
> (gxf->flt_entries_nb + 500),
pointless ()
> --- a/libavformat/utils.c
> +++ b/libavformat/utils.c
> @@ -2569,14 +2569,11 @@ AVStream *avformat_new_stream(AVFormatContext *s,
> AVCodec *c)
> {
> AVStream *st;
> int i;
> - AVStream **streams;
>
> - if (s->nb_streams >= INT_MAX/sizeof(*streams))
> + if (av_reallocp_array(&s->streams, s->nb_streams + 1,
> sizeof(s->streams)) < 0) {
sizeof(s->streams) or sizeof(*s->streams)?
Diego
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel