Commit b85d67cb authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

stream: warn on stream_Read() and stream_Peek() unused result

Both functions can always fail. Even if the stream size is known,
and larger than the requested bytes, reading can fail due to lower
level errors. stream_Peek() can also fail to allocate memory.

Not checking the return value is a bug.
parent 5bf00064
......@@ -109,8 +109,8 @@ enum stream_query_e
STREAM_GET_PRIVATE_BLOCK, /**< arg1= block_t **b, arg2=bool *eof */
};
VLC_API ssize_t stream_Read(stream_t *, void *, size_t);
VLC_API ssize_t stream_Peek(stream_t *, const uint8_t **, size_t);
VLC_API ssize_t stream_Read(stream_t *, void *, size_t) VLC_USED;
VLC_API ssize_t stream_Peek(stream_t *, const uint8_t **, size_t) VLC_USED;
VLC_API int stream_vaControl( stream_t *s, int i_query, va_list args );
VLC_API void stream_Delete( stream_t *s );
VLC_API int stream_Control( stream_t *s, int i_query, ... );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment