diff mbox series

[FFmpeg-devel,v2,4/6] avcodec/golomb: Document return value of get_ue_golomb_30 on error

Message ID 20200714201954.30327-4-andreas.rheinhardt@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel,v2,1/6] avcodec/golomb: Don't emit error message in get_ue_golomb | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Andreas Rheinhardt July 14, 2020, 8:19 p.m. UTC
If the return value is undefined if the value of the encountered
exp golomb code was outside the 0..30 range, said function can't
be used anywhere where one wants to check for correctness. So document
that in this case the return value is outside the range 0..30 (it
currently always returns 32 in this case).

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavcodec/golomb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 775ac9878d..356df2cd92 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -115,7 +115,8 @@  static inline unsigned get_ue_golomb_long(GetBitContext *gb)
 
 /**
  * Read unsigned exp golomb code, constraint to a max of 30.
- * the return value is undefined if the stored value exceeds 30.
+ * The return value is outside 0..30 if no exp golomb code
+ * in that range was encountered.
  */
 static inline int get_ue_golomb_30(GetBitContext *gb)
 {