mirror of https://github.com/mpv-player/mpv
stream_bluray: check fread return value
This commit is contained in:
parent
f89d0d48bc
commit
daa6068d02
|
@ -551,16 +551,18 @@ static bool check_bdmv(const char *path)
|
||||||
if (!temp)
|
if (!temp)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char data[50] = {0};
|
char data[50];
|
||||||
|
bool ret = false;
|
||||||
fread(data, 50, 1, temp);
|
|
||||||
fclose(temp);
|
|
||||||
|
|
||||||
|
if (fread(data, 50, 1, temp) == 1) {
|
||||||
bstr bdata = {data, 50};
|
bstr bdata = {data, 50};
|
||||||
|
ret = bstr_startswith0(bdata, "MOBJ0100") || // AVCHD
|
||||||
return bstr_startswith0(bdata, "MOBJ0100") || // AVCHD
|
|
||||||
bstr_startswith0(bdata, "MOBJ0200") || // Blu-ray
|
bstr_startswith0(bdata, "MOBJ0200") || // Blu-ray
|
||||||
bstr_startswith0(bdata, "MOBJ0300"); // UHD BD
|
bstr_startswith0(bdata, "MOBJ0300"); // UHD BD
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(temp);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Destructively remove the current trailing path component.
|
// Destructively remove the current trailing path component.
|
||||||
|
|
Loading…
Reference in New Issue