Skip to content

Commit 8a2fc67

Browse files
TEMP
1 parent 5e8bc85 commit 8a2fc67

14 files changed

+100
-68
lines changed

.github/workflows/MediaInfoLib_Checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
env:
3737
S3_KEY: ${{ secrets.S3_KEY }}
3838
S3_PASS: ${{ secrets.S3_PASS }}
39-
CXXFLAGS: ${{ matrix.CXXFLAGS }}
39+
CXXFLAGS: -Werror -Wno-error=deprecated-declarations ${{ matrix.CXXFLAGS }}
4040
RUN_TESTS: ${{ matrix.RUN_TESTS }}
4141
steps:
4242
- name: Checkout

Source/MediaInfo/Audio/File_Ac3.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,15 +212,15 @@ const char* AC3_ChannelLayout_lfeon[]=
212212
};
213213

214214
//---------------------------------------------------------------------------
215-
extern const char* AC3_roomtyp[]=
215+
const char* AC3_roomtyp[]=
216216
{
217217
"Large",
218218
"Small",
219219
"3",
220220
};
221221

222222
//---------------------------------------------------------------------------
223-
extern const char* AC3_dmixmod[]=
223+
const char* AC3_dmixmod[]=
224224
{
225225
"Lt/Rt",
226226
"Lo/Ro",

Source/MediaInfo/Audio/File_Adm.cpp

+48-42
Large diffs are not rendered by default.

Source/MediaInfo/File__Analyze_Streams.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void File__Analyze::Get_MasteringDisplayColorVolume(Ztring &MasteringDisplay_Col
421421
#endif
422422

423423
//---------------------------------------------------------------------------
424-
extern const char* DolbyVision_Compatibility[] =
424+
const char* DolbyVision_Compatibility[] =
425425
{
426426
"",
427427
"HDR10",
@@ -504,7 +504,7 @@ static void DolbyVision_Profiles_Append(string& Profile, int8u i)
504504
return add_dec_2chars(Profile, i);
505505
Profile.append(DolbyVision_Profiles_Names+((size_t)j)*4, 4);
506506
}
507-
extern const char* DolbyVision_Compression[] =
507+
const char* DolbyVision_Compression[] =
508508
{
509509
"None",
510510
"Limited",
@@ -1913,7 +1913,7 @@ const Ztring &File__Analyze::Retrieve_Const (stream_t StreamKind, size_t StreamP
19131913
|| StreamPos>=(*Stream)[StreamKind].size()
19141914
|| Parameter>=MediaInfoLib::Config.Info_Get(StreamKind).size()+(*Stream_More)[StreamKind][StreamPos].size())
19151915
{
1916-
if (StreamKind<sizeof(Fill_Temp)/sizeof(vector<fill_temp_item>))
1916+
if ((size_t)StreamKind<sizeof(Fill_Temp)/sizeof(*Fill_Temp))
19171917
{
19181918
Ztring Parameter_Local;
19191919
Parameter_Local.From_Number(Parameter);

Source/MediaInfo/Multiple/File_Ancillary.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -529,9 +529,8 @@ void File_Ancillary::Read_Buffer_Unsynched()
529529
//---------------------------------------------------------------------------
530530
void File_Ancillary::Header_Parse()
531531
{
532-
switch (Format)
532+
if (Format==Smpte2038)
533533
{
534-
case Smpte2038:
535534
BS_Begin();
536535
Skip_S1(6, "000000");
537536
Skip_SB( "c_not_y_channel_flag");

Source/MediaInfo/Multiple/File_DvDif_Analysis.cpp

+4-5
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,10 @@ void File_DvDif::Read_Buffer_Continue()
620620
uint8_t Dseq=Buffer[Buffer_Offset+1]>>4;
621621
bool Is16=(QU==(int8u)-1)?(Contains_8000):(QU==0);
622622
int16u Value;
623-
switch (Is16)
624-
{
625-
case 0: Value=(Contains_800800_0<<4)|(Contains_800800_1>>4); break; // Only one half
626-
case 1: Value=(ToCheck_8000_0<<8)|ToCheck_8000_1; break;
627-
}
623+
if (Is16)
624+
Value=(ToCheck_8000_0<<8)|ToCheck_8000_1;
625+
else
626+
Value=(Contains_800800_0<<4)|(Contains_800800_1>>4); // Only one half
628627
if (Value && Value!=(0xFFFF>>(Is16?0:4))) // 0 and -1 are often used as silence
629628
{
630629
if (Channel>=Audio_Errors.size())

Source/MediaInfo/Multiple/File_Mpeg4_Descriptors.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ int8u Mpeg4_Descriptors_ToAudioProfileLevelIndication(const profilelevel_struct&
333333
{
334334
case UnspecifiedAudio : return 0xFE;
335335
case NoAudio : return 0xFF;
336+
default:;
336337
}
337338
for (size_t i = 0; i < Mpeg4_Descriptors_AudioProfileLevelIndication_Size; i++)
338339
if (ToMatch == Mpeg4_Descriptors_AudioProfileLevelIndication_Mapping[i])

Source/MediaInfo/Multiple/File_Mpeg4_Elements.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@ void File_Mpeg4::mdat_xxxx()
21942194
}
21952195
else
21962196
{
2197-
mdat_Pos=move(mdat_Pos_Caption);
2197+
mdat_Pos=std::move(mdat_Pos_Caption);
21982198
std::sort(mdat_Pos.begin(), mdat_Pos.end(), &mdat_pos_sort);
21992199
size_t mdat_Pos_Min=(size_t)-1;
22002200
size_t mdat_Pos_Max=0;
@@ -2214,6 +2214,9 @@ void File_Mpeg4::mdat_xxxx()
22142214
{
22152215
auto Probe=Config->File_ProbeCaption_Get(ParserName);
22162216
switch (Probe.Start_Type) {
2217+
case config_probe_none:
2218+
ProbeCaption_mdatPos=File_Size;
2219+
break;
22172220
case config_probe_dur:
22182221
ProbeCaption_mdatPos=Probe.Start*FrameRate;
22192222
break;
@@ -2227,6 +2230,9 @@ void File_Mpeg4::mdat_xxxx()
22272230
break;
22282231
}
22292232
switch (Probe.Duration_Type) {
2233+
case config_probe_none:
2234+
ProbeCaption_mdatDur=0;
2235+
break;
22302236
case config_probe_dur:
22312237
ProbeCaption_mdatDur=Probe.Duration*FrameRate;
22322238
break;

Source/MediaInfo/Multiple/File_Mpeg_Descriptors.cpp

+6-4
Original file line numberDiff line numberDiff line change
@@ -2583,13 +2583,15 @@ void File_Mpeg_Descriptors::Descriptor_3F_14()
25832583
Complete_Stream->Streams[elementary_PID]->Infos["BitRate_Maximum"].From_Number(brat*1000000);
25842584
if (Framerate_Numerator && Framerate_Denominator && Framerate_Denominator<=2)
25852585
{
2586+
int32u Num=Framerate_Numerator;
2587+
int32u Den=Framerate_Denominator;
25862588
if (Framerate_Denominator==2)
25872589
{
2588-
Framerate_Numerator*=1000;
2589-
Framerate_Denominator=1001;
2590+
Num*=1000;
2591+
Den=1001;
25902592
}
2591-
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Num"].From_Number(Framerate_Numerator);
2592-
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Den"].From_Number(Framerate_Denominator);
2593+
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Num"].From_Number(Num);
2594+
Complete_Stream->Streams[elementary_PID]->Infos["FrameRate_Den"].From_Number(Den);
25932595
}
25942596
if (Interlace_Mode!=3)
25952597
{

Source/MediaInfo/Multiple/File_Mxf.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -15661,6 +15661,9 @@ bool File_Mxf::BookMark_Needed()
1566115661
}
1566215662
switch (Probe.Start_Type)
1566315663
{
15664+
case config_probe_none:
15665+
ProbeCaptionBytePos=0;
15666+
break;
1566415667
case config_probe_size:
1566515668
ProbeCaptionBytePos=Probe.Start;
1566615669
break;
@@ -15678,6 +15681,9 @@ bool File_Mxf::BookMark_Needed()
1567815681
default:;
1567915682
}
1568015683
switch (Probe.Duration_Type) {
15684+
case config_probe_none:
15685+
ProbeCaptionByteDur=ContentSize;
15686+
break;
1568115687
case config_probe_size:
1568215688
ProbeCaptionByteDur=Probe.Duration;
1568315689
break;

Source/MediaInfo/Multiple/File_Nsv.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -786,6 +786,7 @@ void File_Nsv::Data_Parse()
786786
if (P->AudioDelay!=numeric_limits<int64s>::min() && Retrieve(Stream_Audio, 0, Audio_Delay).empty())
787787
Fill(Stream_Audio, 0, Audio_Delay, float64_int64s(((float64)P->AudioDelay)/1000000));
788788
break;
789+
default:;
789790
}
790791
}
791792
}

Source/MediaInfo/Text/File_N19.cpp

+11-5
Original file line numberDiff line numberDiff line change
@@ -679,7 +679,7 @@ void File_N19::Data_Parse()
679679
{
680680
switch (Value)
681681
{
682-
case 0x8A: //EOL
682+
case (decltype(Value))0x8A: //EOL
683683
if (Line_HasContent)
684684
{
685685
LineCount++;
@@ -705,9 +705,11 @@ void File_N19::Data_Parse()
705705
}
706706
#if MEDIAINFO_TRACE
707707
for (size_t i = 0; i < TF.size(); ++i)
708-
switch (TF[i])
708+
{
709+
auto Value=TF[i];
710+
switch (Value)
709711
{
710-
case 0x8A: //EOL
712+
case (decltype(Value))0x8A: //EOL
711713
TF[i] = EOL[0];
712714
{
713715
size_t j = 1;
@@ -720,15 +722,18 @@ void File_N19::Data_Parse()
720722
|| (TF[i]>=0x7F && TF[i]<0xA0))
721723
TF.erase(i--, 1);
722724
}
725+
}
723726
Param_Info1(TF);
724727
#endif //MEDIAINFO_TRACE
725728

726729
FILLING_BEGIN();
727730
#if MEDIAINFO_DEMUX
728731
for (size_t i = 0; i < TF.size(); ++i)
729-
switch (TF[i])
732+
{
733+
auto Value=TF[i];
734+
switch (Value)
730735
{
731-
case 0x8A: //EOL
736+
case (decltype(Value))0x8A: //EOL
732737
TF[i] = EOL[0];
733738
{
734739
size_t j = 1;
@@ -741,6 +746,7 @@ void File_N19::Data_Parse()
741746
|| (TF[i]>=0x7F && TF[i]<0xA0))
742747
TF.erase(i--, 1);
743748
}
749+
}
744750

745751
Frame_Count_NotParsedIncluded=Frame_Count;
746752

Source/MediaInfo/Video/File_Hevc.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1643,7 +1643,7 @@ void File_Hevc::video_parameter_set()
16431643
TESTELSE_SB_SKIP( "vps_extension_flag");
16441644
int8u view_id_len;
16451645
bool splitting_flag, vps_nuh_layer_id_present_flag;
1646-
for (auto Bits=Data_BS_Remain()%8; Bits--; Bits)
1646+
for (auto Bits=(Data_BS_Remain()%8); Bits; Bits--)
16471647
Mark_1();
16481648
if (vps_max_layers_minus1 && vps_base_layer_internal_flag)
16491649
{

Source/PreRelease/FieldsDescription.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ const char* StreamKinds[] =
2727

2828
ZtringListList Load(const string& Name, const char* ToAdd = nullptr, bool IgnoreErrors = false) {
2929
File InF(Ztring().From_Local(Name));
30-
auto Size = InF.Size_Get();
30+
auto InF_Size = InF.Size_Get();
31+
if (InF_Size > ((size_t)-1) / 2)
32+
return {};
33+
auto Size = (size_t)InF_Size;
3134
if (Size == 0) {
3235
if (!IgnoreErrors)
3336
std::cerr << "Can not open " << Name << '\n';
@@ -157,7 +160,10 @@ int main(int argc, char* argv[]) {
157160

158161
string Name = string(argv[2]) + "/src/MediaInfoBundle/Resources/views/Support/fields.html.twig";
159162
File OutputF(Ztring().From_Local(Name));
160-
auto Size = OutputF.Size_Get();
163+
auto OutputF_Size = OutputF.Size_Get();
164+
if (OutputF_Size > ((size_t)-1) / 2)
165+
return {};
166+
auto Size = (size_t)OutputF_Size;
161167
if (Size == 0) {
162168
std::cerr << "Can not open " << Name << '\n';
163169
return 1;

0 commit comments

Comments
 (0)