On Mon, Sep 24, 2018 at 12:04:12AM +0200, Marton Balint wrote:
> 
> 
> On Sun, 23 Sep 2018, Michael Niedermayer wrote:
> 
> >On Sat, Sep 22, 2018 at 11:53:22PM +0200, Marton Balint wrote:
> >>These are based on the very similar UDP and RTP protocol functions.
> >>
> >>Signed-off-by: Marton Balint <c...@passwd.hu>
> >>---
> >> libavformat/ip.c | 165 
> >> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> >> libavformat/ip.h |  74 +++++++++++++++++++++++++
> >> 2 files changed, 239 insertions(+)
> >> create mode 100644 libavformat/ip.c
> >> create mode 100644 libavformat/ip.h
> >[...]
> >>+/**
> >>+ * Parses the address[,address] source list in buf and adds it to the 
> >>filters
> >>+ * in the IPSourceFilters structure.
> >>+ * @param buf is the source list, which is not changed, but must be 
> >>writable
> >>+ * @return 0 on success, < 0 AVERROR code on error.
> >>+ */
> >>+int ff_ip_parse_sources(void *log_ctx, char *buf, IPSourceFilters 
> >>*filters);
> >>+
> >>+/**
> >>+ * Parses the address[,address] source block list in buf and adds it to the
> >>+ * filters in the IPSourceFilters structure.
> >>+ * @param buf is the source list, which is not changed, but must be 
> >>writable
> >
> >if its not changed, why does it need to be writable ?
> 
> Becasue the during the parsing the ',' is replaced with '\0' temporarily.

this implies that the buffer cannot be shared with another thread.
(which while unlikely could if its done result in very hard to reproduce
 bugs)
This should be at least documented more clearly but i think it would be best
to avoid these temporary writes as they are unexpected.
 

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin

Attachment: signature.asc
Description: PGP signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to