[x265] [PATCH] NALWrite : do not use malloc, realloc and free

Jean-Baptiste Kempf jb at videolan.org
Wed Sep 18 13:36:31 CEST 2013


On 18 Sep, Gopu Govindaswamy wrote :
> -    out = (uint8_t *) realloc (out, (rbsp.end() - rbsp.begin()) + 4 );
> -    memcpy(out + packetSize, &(*rbsp.begin()), rbsp.end() - rbsp.begin());
> +	UInt offset = rbsp.end() - rbsp.begin();
> +    out = (uint8_t *) X265_MALLOC(uint8_t, packetSize +  offset + 4 );
> +    ::memcpy(out, bsNALUHeader.getByteStream(), packetSize);
> +    ::memcpy(out + packetSize, &(*rbsp.begin()), rbsp.end() - rbsp.begin());

No Tabs in source code.

You really should set your editor to no-tabs and to trim end-of-line
whitespace


-- 
Jean-Baptiste Kempf
http://www.jbkempf.com/ - +33 672 704 734
Sent from my Electronic Device


More information about the x265-devel mailing list