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.rheinha...@gmail.com>
---
Btw: get_ue_golomb_30() could be used to skip exp golomb codes with
length <= 17 bits.

 libavcodec/golomb.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavcodec/golomb.h b/libavcodec/golomb.h
index 172d9934e0..8b69196d44 100644
--- a/libavcodec/golomb.h
+++ b/libavcodec/golomb.h
@@ -135,7 +135,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 the range of 0..30 if no exp golomb code
+ * in that range was encountered.
  */
 static inline int get_ue_golomb_30(GetBitContext *gb)
 {
-- 
2.20.1

_______________________________________________
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