+ source->source_eof = true;
+ if (source->padding_bytes_available > 0) {
+ unsigned padding_to_add = source->padding_bytes_available;
+ if (padding_to_add > bytes_to_read) {
+ padding_to_add = bytes_to_read;
+ }
+ memset(source->bytes + source->bytes_available, 0, padding_to_add);
+ source->padding_bytes_available -= padding_to_add;
+ source->bytes_available += padding_to_add;
+ } else {
+ fprintf(stderr, "Premature EOF\n");
+ exit(1);
+ }
+ } else {
+ source->bytes_available += bytes_read;