Unified · Split
| @@ -551,16 +551,18 @@ static bool check_bdmv(const char *path) · 550 unmodified lines | ||
| 551 | 551 | if (!temp) |
| 552 | 552 | return false; |
| 553 | 553 | |
| 554 | − char data[50] = {0}; | |
| 554 | + char data[50]; | |
| 555 | + bool ret = false; | |
| 556 | + | |
| 557 | + if (fread(data, 50, 1, temp) == 1) { | |
| 558 | + bstr bdata = {data, 50}; | |
| 559 | + ret = bstr_startswith0(bdata, "MOBJ0100") || // AVCHD | |
| 560 | + bstr_startswith0(bdata, "MOBJ0200") || // Blu-ray | |
| 561 | + bstr_startswith0(bdata, "MOBJ0300"); // UHD BD | |
| 562 | + } | |
| 555 | 563 | |
| 556 | − fread(data, 50, 1, temp); | |
| 557 | 564 | fclose(temp); |
| 558 | − | |
| 559 | − bstr bdata = {data, 50}; | |
| 560 | − | |
| 561 | − return bstr_startswith0(bdata, "MOBJ0100") || // AVCHD | |
| 562 | − bstr_startswith0(bdata, "MOBJ0200") || // Blu-ray | |
| 563 | − bstr_startswith0(bdata, "MOBJ0300"); // UHD BD | |
| 565 | + return ret; | |
| 564 | 566 | } |
| 565 | 567 | |
| 566 | 568 | // Destructively remove the current trailing path component. |