Fix EOF in MiniVHD files. Patch from shermanp.
This commit is contained in:
parent
cada868428
commit
e791bf372b
12 changed files with 12 additions and 12 deletions
|
|
@ -444,4 +444,4 @@ NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE. */
|
THE SOFTWARE. */
|
||||||
|
|
|
||||||
|
|
@ -9,4 +9,4 @@ int UTF16LEToUTF8(unsigned char* out, int *outlen, const unsigned char* inb, int
|
||||||
int UTF8ToUTF16LE(unsigned char* outb, int *outlen, const unsigned char* in, int *inlen);
|
int UTF8ToUTF16LE(unsigned char* outb, int *outlen, const unsigned char* in, int *inlen);
|
||||||
int UTF16BEToUTF8(unsigned char* out, int *outlen, const unsigned char* inb, int *inlenb);
|
int UTF16BEToUTF8(unsigned char* out, int *outlen, const unsigned char* inb, int *inlenb);
|
||||||
int UTF8ToUTF16BE(unsigned char* outb, int *outlen, const unsigned char* in, int *inlen);
|
int UTF8ToUTF16BE(unsigned char* outb, int *outlen, const unsigned char* in, int *inlen);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -266,4 +266,4 @@ int mvhd_write_sectors(MVHDMeta* vhdm, uint32_t offset, int num_sectors, void* i
|
||||||
* \return the number of sectors that were not written, or zero
|
* \return the number of sectors that were not written, or zero
|
||||||
*/
|
*/
|
||||||
int mvhd_format_sectors(MVHDMeta* vhdm, uint32_t offset, int num_sectors);
|
int mvhd_format_sectors(MVHDMeta* vhdm, uint32_t offset, int num_sectors);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -105,4 +105,4 @@ FILE* mvhd_convert_to_raw(const char* utf8_vhd_path, const char* utf8_raw_path,
|
||||||
mvhd_close(vhdm);
|
mvhd_close(vhdm);
|
||||||
mvhd_fseeko64(raw_img, 0, SEEK_SET);
|
mvhd_fseeko64(raw_img, 0, SEEK_SET);
|
||||||
return raw_img;
|
return raw_img;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -482,4 +482,4 @@ MVHDMeta* mvhd_create_ex(MVHDCreationOptions options, int* err) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL; /* Make the compiler happy */
|
return NULL; /* Make the compiler happy */
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,4 +5,4 @@
|
||||||
|
|
||||||
MVHDMeta* mvhd_create_fixed_raw(const char* path, FILE* raw_img, uint64_t size_in_bytes, MVHDGeom* geom, int* err, mvhd_progress_callback progress_callback);
|
MVHDMeta* mvhd_create_fixed_raw(const char* path, FILE* raw_img, uint64_t size_in_bytes, MVHDGeom* geom, int* err, mvhd_progress_callback progress_callback);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -93,4 +93,4 @@ struct MVHDMeta {
|
||||||
} format_buffer;
|
} format_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -276,4 +276,4 @@ int mvhd_sparse_diff_write(MVHDMeta* vhdm, uint32_t offset, int num_sectors, voi
|
||||||
|
|
||||||
int mvhd_noop_write(MVHDMeta* vhdm, uint32_t offset, int num_sectors, void* in_buff) {
|
int mvhd_noop_write(MVHDMeta* vhdm, uint32_t offset, int num_sectors, void* in_buff) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,4 +129,4 @@ int mvhd_sparse_diff_write(MVHDMeta* vhdm, uint32_t offset, int num_sectors, voi
|
||||||
*/
|
*/
|
||||||
int mvhd_noop_write(MVHDMeta* vhdm, uint32_t offset, int num_sectors, void* in_buff);
|
int mvhd_noop_write(MVHDMeta* vhdm, uint32_t offset, int num_sectors, void* in_buff);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -532,4 +532,4 @@ int mvhd_format_sectors(MVHDMeta* vhdm, uint32_t offset, int num_sectors) {
|
||||||
}
|
}
|
||||||
vhdm->write_sectors(vhdm, offset, remain, vhdm->format_buffer.zero_data);
|
vhdm->write_sectors(vhdm, offset, remain, vhdm->format_buffer.zero_data);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -164,4 +164,4 @@ void mvhd_header_to_buffer(MVHDSparseHeader* header, uint8_t* buffer) {
|
||||||
mvhd_next_struct_to_buffer(&header->par_loc_entry[i].plat_data_offset, sizeof header->par_loc_entry[i].plat_data_offset, true, &buff_ptr);
|
mvhd_next_struct_to_buffer(&header->par_loc_entry[i].plat_data_offset, sizeof header->par_loc_entry[i].plat_data_offset, true, &buff_ptr);
|
||||||
}
|
}
|
||||||
mvhd_next_struct_to_buffer(&header->reserved_2, sizeof header->reserved_2, false, &buff_ptr);
|
mvhd_next_struct_to_buffer(&header->reserved_2, sizeof header->reserved_2, false, &buff_ptr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,4 +35,4 @@ void mvhd_footer_to_buffer(MVHDFooter* footer, uint8_t* buffer);
|
||||||
*/
|
*/
|
||||||
void mvhd_header_to_buffer(MVHDSparseHeader* header, uint8_t* buffer);
|
void mvhd_header_to_buffer(MVHDSparseHeader* header, uint8_t* buffer);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue