On Wed, Feb 02, 2022 at 03:23:34PM +0100, Mark Gaiser wrote: > On Wed, Feb 2, 2022 at 2:29 PM Michael Niedermayer > wrote: > > > On Tue, Feb 01, 2022 at 10:58:30PM +0100, Mark Gaiser wrote: [...] > > > > > > > + AVClass *class; > > > + URLContext *inner; > > > + char *gateway; > > > +} Context; > > > + > > > +// A best-effort way to find the IPFS gateway. > > > +// Only the most appropiate gateway is set. It's not actually requested > > (http call) to prevent > > > +// a potential slowdown in startup. A potential timeout is handled by > > the HTTP protocol. > > > +// > > > +// When done and the return value is 1, a potential IPFS Gateway is set > > in the gateway > > > +// variable in the inner URLContext. > > > > > +static int ff_populate_ipfs_gateway(URLContext *h) > > > > ff_ prefix seems not needed > > > > Done. Removed the prefix from both functions. > For the record, I thought it was mandatory to prefix internal functions > with "ff_"? only non static ones, these prefixes are to avoid conflicing with other things in the global namespace [...] > > > > > > > > > + } > > > + > > > > > + fscanf(gateway_file, "%[^\n]", gateway_file_data); > > > > how large is the array ? > > how large is the data written into the array ? > > what is the relation between the 2 ? > > > > Yeah... I'm going to need more information on that one. > What do you mean? > Is this wrong? the array is fixed length, the string written into it is from some external file IIRC. Maybe i missed a check but to me it seemed like the array end can be overwritten which is bad thx [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Awnsering whenever a program halts or runs forever is On a turing machine, in general impossible (turings halting problem). On any real computer, always possible as a real computer has a finite number of states N, and will either halt in less than N cycles or never halt.