ref: 5ba01a5a45c8b9924c68c690d7c648593e17b21c
parent: 9251ff3ad722214ad9608737dd477b4c0b4206a5
author: James Zern <[email protected]>
date: Mon Mar 3 13:40:06 EST 2014
nestegg: quiet read related uint64->size_t warnings ne_read_ebml_lacing / ne_read_discard_padding + add some asserts Change-Id: I28d0ec5c8f901ae0a35928a8f512c51b3ecf177d
--- a/third_party/nestegg/README.webm
+++ b/third_party/nestegg/README.webm
@@ -20,3 +20,4 @@
- nestegg_packet_track: fix uint64->uint32 warning
- ne_read_(string|binary|block): normalize size_t usage
- ne_parse: normalize size_t usage
+- quiet read related uint64->size_t warnings
--- a/third_party/nestegg/src/nestegg.c
+++ b/third_party/nestegg/src/nestegg.c
@@ -1152,7 +1152,8 @@
r = ne_read_vint(io, &lace, &length);
if (r != 1)
return r;
- *read += length;
+ assert(length <= 8);
+ *read += (size_t)length;
sizes[i] = lace;
sum = sizes[i];
@@ -1164,7 +1165,8 @@
r = ne_read_svint(io, &slace, &length);
if (r != 1)
return r;
- *read += length;
+ assert(length <= 8);
+ *read += (size_t)length;
sizes[i] = sizes[i - 1] + slace;
sum += sizes[i];
i += 1;
@@ -1408,7 +1410,8 @@
if (!element)
return 1;
- r = ne_read_simple(ctx, element, size);
+ assert((size_t)size == size);
+ r = ne_read_simple(ctx, element, (size_t)size);
if (r != 1)
return r;
storage = (struct ebml_type *) (ctx->ancestor->data + element->offset);