[FFmpeg-devel] [PATCH] Use av_mallocz in url_open_protocol for URLContext
Wed Jan 27 00:32:27 CET 2010
If you register a protocol which uses private data then
av_open_protocol's url_seek() to determine whether the protocol
supports streaming will be called with uninitialized private data.
If say you use the private data in your custom seek bad things
happen. By using av_mallocz the priv_data is initialized to zero
and you can return -1 with the errno set until you can initialize
the priv_data after the av_open_protocol() call (and initialize
is_streamed as well if applicable).
The other way to handle this by creating your own URLContext
without a registered protocol is error prone. As an alternative
to av_mallocz, av_open_protocol() could just initialize priv_data
to NULL as it does other parts of the structure, if that is
preferred I can make a patch for that.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 424 bytes
Desc: not available
More information about the ffmpeg-devel