Skip to content

Commit

Permalink
Fix issues flagged by Visual Studio Code analysis
Browse files Browse the repository at this point in the history
For `MediaInfo_Inform` and `File_Mpeg4_Elements` only.
  • Loading branch information
cjee21 committed Jan 30, 2025
1 parent 993f800 commit 0ecfcae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Source/MediaInfo/MediaInfo_Inform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ namespace
{
struct nested
{
std::vector<Node*>* Target;
std::vector<Node*>* Target{};
Ztring Name;
};
}
Expand Down
16 changes: 10 additions & 6 deletions Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1677,10 +1677,11 @@ void File_Mpeg4::ftyp()
#if MEDIAINFO_CONFORMANCE
IsCmaf=true;
#endif
//fall through
[[fallthrough]]; //fall through
case Elements::ftyp_dash :
if (Config->File_Names.size()==1)
TestContinuousFileNames(1, __T("m4s"));
[[fallthrough]];
default : ;
}
CodecID_Fill(Ztring().From_CC4(MajorBrand), Stream_General, 0, InfoCodecID_Format_Mpeg4);
Expand Down Expand Up @@ -2217,7 +2218,7 @@ void File_Mpeg4::mdat_xxxx()
Probe.Start=Probe.Start*100/File_Size; //File pos is not relevant there
if (!Probe.Start)
Probe.Start=50;
// Fall through
[[fallthrough]]; // Fall through
case config_probe_percent:
ProbeCaption_mdatPos=Stream.second.stts_FrameCount*Probe.Start/100;
break;
Expand All @@ -2230,7 +2231,7 @@ void File_Mpeg4::mdat_xxxx()
Probe.Duration=Probe.Duration*100/File_Size; //File pos is not relevant there
if (!Probe.Duration)
Probe.Duration++;
// Fall through
[[fallthrough]]; // Fall through
case config_probe_percent:
ProbeCaption_mdatDur=Stream.second.stts_FrameCount*Probe.Duration/100;
break;
Expand Down Expand Up @@ -2289,7 +2290,7 @@ void File_Mpeg4::mdat_xxxx()
{
if (!Stream_Temp.Parsers[Pos]->Status[IsAccepted] && Stream_Temp.Parsers[Pos]->Status[IsFinished])
{
delete *(Stream_Temp.Parsers.begin()+Pos);
delete static_cast<MediaInfoLib::File__Analyze*>(*(Stream_Temp.Parsers.begin()+Pos));
Stream_Temp.Parsers.erase(Stream_Temp.Parsers.begin()+Pos);
Pos--;
}
Expand All @@ -2299,7 +2300,7 @@ void File_Mpeg4::mdat_xxxx()
for (size_t Pos2=0; Pos2<Stream_Temp.Parsers.size(); Pos2++)
{
if (Pos2!=Pos)
delete *(Stream_Temp.Parsers.begin()+Pos2);
delete static_cast<MediaInfoLib::File__Analyze*>(*(Stream_Temp.Parsers.begin()+Pos2));
}
Stream_Temp.Parsers_Clear();
Stream_Temp.Parsers.push_back(Parser);
Expand Down Expand Up @@ -3556,6 +3557,7 @@ void File_Mpeg4::moov_meta_ilst_xxxx_data()
//Not normal
Kind=0x00;
}
[[fallthrough]];
default : ;
}

Expand Down Expand Up @@ -4025,6 +4027,7 @@ void File_Mpeg4::moov_meta_ilst_xxxx_data()
Fill(Stream_General, 0, Parameter.c_str(), Value, true);
FILLING_END();
}
break;
default: ;
}
}
Expand Down Expand Up @@ -4405,6 +4408,7 @@ void File_Mpeg4::moov_trak_mdia_hdlr()
break;
case Elements::moov_trak_mdia_hdlr_MPEG :
mdat_MustParse=true; //Data is in MDAT
break;
case Elements::moov_trak_mdia_hdlr_alis :
//Stream_Prepare(Stream_Other);
//Fill(Stream_Other, StreamPos_Last, Other_Type, "Alias"); //TODO: what is the meaning of such hdlr?
Expand Down Expand Up @@ -5124,7 +5128,7 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_sgpd()
}

//Parsing
int32u grouping_type, Count, default_length;
int32u grouping_type, Count, default_length{};
Get_C4 (grouping_type, "grouping_type");
if (Version==1)
Get_B4 (default_length, "default_length");
Expand Down

0 comments on commit 0ecfcae

Please sign in to comment.