On 7/4/2023 4:59 PM, Anton Khirnov wrote:

Not if any of the functions above were called but failed to fill the buffer.

I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and
return AVERROR_INVALIDDATA outside.

AVERROR_INVALIDDATA is defined as 'Invalid data found when processing
input'.
This function does not process any input, so IMO that code never makes
sense for it.

I'd say make it ENOSYS, AVERROR_UNKNOWN, or keep around one of
individual method errors.

For the cases read() is used for /dev/random/, i can return AVERROR(errno), given the doxy states read() returns -1 on error and sets errno to some value. Although if it succeeds and returns a value smaller than len i would need to return AVERROR_UNKNOWN like you suggested.

RAND_bytes from OpenSSL returns 0 or -1 on error, so nothing i can propagate.
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to