Commit 3da1c9c8 authored by Edward Hervey's avatar Edward Hervey 🤘

codecparsers: Add READ_UE_MAX macro

READ_UE_ALLOWED was almost exclusively used with min == 0, which doesn't
make much point for unsigned integers.

Add a READ_UE_MAX variant and use that instead. Also replaced two usages
of CHECK_ALLOWED (a,0,something) by CHECK_ALLOWED_MAX (a, something)
parent e53627c2
This diff is collapsed.
This diff is collapsed.
......@@ -138,6 +138,13 @@ gboolean nal_reader_get_se (NalReader * nr, gint32 * val);
val = tmp; \
#define READ_UE_MAX(nr, val, max) { \
guint32 tmp; \
READ_UE (nr, tmp); \
CHECK_ALLOWED_MAX (tmp, max); \
val = tmp; \
#define READ_SE(nr, val) { \
if (!nal_reader_get_se (nr, &val)) { \
GST_WARNING ("failed to read SE"); \
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment