@@ -724,7 +724,7 @@ void APar_ShowObjectProfileInfo(uint8_t track_type, TrackInfo *track_info) {
724
724
} // end switch
725
725
} // end level if
726
726
} else if (track_type == S_AMR_TRACK) {
727
- char * amr_modes = ( char *) calloc ( 1 , sizeof ( char ) * 500 ) ;
727
+ char amr_modes[ 500 ] = {} ;
728
728
if (track_info->track_codec == 0x73616D72 ||
729
729
track_info->track_codec == 0x73617762 ) {
730
730
if (track_info->amr_modes & 0x0001 )
@@ -786,9 +786,6 @@ void APar_ShowObjectProfileInfo(uint8_t track_type, TrackInfo *track_info) {
786
786
" AMR VBR Wide-Band. Encoder vendor code: %s\n " ,
787
787
track_info->encoder_name );
788
788
}
789
- free (amr_modes);
790
- amr_modes = NULL ;
791
-
792
789
} else if (track_type == EVRC_TRACK) {
793
790
fprintf (stdout,
794
791
" EVRC (Enhanced Variable Rate Coder). Encoder vendor code: %s\n " ,
@@ -821,7 +818,6 @@ void APar_ShowObjectProfileInfo(uint8_t track_type, TrackInfo *track_info) {
821
818
fprintf (stdout, " channels: [%u]\n " , track_info->channels );
822
819
}
823
820
}
824
- return ;
825
821
}
826
822
827
823
// /////////////////////////////////////////////////////////////////////////////////////
@@ -1592,7 +1588,7 @@ void APar_Print_TrackDetails(TrackInfo *track_info) {
1592
1588
}
1593
1589
1594
1590
void APar_ExtractDetails (FILE *isofile, uint8_t optional_output) {
1595
- char * uint32_buffer = ( char *) malloc ( sizeof ( char ) * 5 ) ;
1591
+ char uint32_buffer[ 5 ] ;
1596
1592
Trackage track = {0 };
1597
1593
1598
1594
AtomicInfo *mvhdAtom = APar_FindAtom (" moov.mvhd" , false , VERSIONED_ATOM, 0 );
@@ -1692,14 +1688,13 @@ void APar_ExtractDetails(FILE *isofile, uint8_t optional_output) {
1692
1688
}
1693
1689
}
1694
1690
}
1695
- return ;
1696
1691
}
1697
1692
1698
1693
// provided as a convenience function so that 3rd party utilities can know
1699
1694
// beforehand
1700
1695
void APar_ExtractBrands (char *filepath) {
1701
1696
FILE *a_file = APar_OpenISOBaseMediaFile (filepath, true );
1702
- char * buffer = ( char *) calloc ( 1 , sizeof ( char ) * 16 ) ;
1697
+ char buffer[ 16 ] = {} ;
1703
1698
uint32_t atom_length = 0 ;
1704
1699
uint8_t file_type_offset = 0 ;
1705
1700
uint32_t compatible_brand = 0 ;
@@ -1779,8 +1774,4 @@ void APar_ExtractBrands(char *filepath) {
1779
1774
fprintf (stdout,
1780
1775
" ISO-copyright notices @ movie and/or track level "
1781
1776
" allowed.\n uuid private user extension tags allowed.\n " );
1782
-
1783
- free (buffer);
1784
- buffer = NULL ;
1785
- return ;
1786
1777
}
0 commit comments