bytestream: Make get_bytes_left compatible with overread

Multimedia / FFmpeg - Andreas Rheinhardt [gmail.com] - 5 March 2020 23:58 UTC

bytestream2_get_bytes_left returns an unsigned int; as a result, it returns big positive numbers if an overread already happened, making it unsuitable for scenarios where one wants to allow this in a controlled way (because the buffer is actually padded so that no segfaults can happen). So change it to return an ordinary int.

Also, bytestream2_get_bytes_left_p has been modified in the same way.

7f96325bc4 bytestream: Make get_bytes_left compatible with overread
libavcodec/bytestream.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

  • Share