History

stream_bluray: check fread return value

llyyr committed 2 years ago

Commit daa60681 parent f89d0d41 file · +10 −8Browse files

Unified · Split

stream/stream_bluray.c+10−8
@@ -551,16 +551,18 @@ static bool check_bdmv(const char *path) · 550 unmodified lines
551 if (!temp)551 if (!temp)
552 return false;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 fclose(temp);564 fclose(temp);
558 565 return ret;
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
564}566}
565 567
566// Destructively remove the current trailing path component.568// Destructively remove the current trailing path component.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t