Open Randrianasulu opened 2 years ago
I think we'd have to check the initialisation, but thanks for reporting. Perhaps if it is a real issue we can include cppcheck in our PR checks to avoid similar issues in the future.
Also reported by clang tidy regarding track:
C:\Users\jcder\Source\Repos\tsMuxer-master\tsMuxer\matroskaDemuxer.cpp(1944,16): warning G00478196: Potential leak of memory pointed to by 'track' [clang-analyzer-cplusplus.NewDeleteLeaks]
return res;
^
C:\Users\jcder\Source\Repos\tsMuxer-master\tsMuxer\matroskaDemuxer.cpp:1934:30: note: Memory is allocated
track = (MatroskaTrack *)new char[MAX_TRACK_SIZE];
^
C:\Users\jcder\Source\Repos\tsMuxer-master\tsMuxer\matroskaDemuxer.cpp:1938:9: note: Assuming 'MAX_STREAMS' is >= field 'num_tracks'
if (num_tracks > MAX_STREAMS)
^
C:\Users\jcder\Source\Repos\tsMuxer-master\tsMuxer\matroskaDemuxer.cpp:1938:5: note: Taking false branch
if (num_tracks > MAX_STREAMS)
^
C:\Users\jcder\Source\Repos\tsMuxer-master\tsMuxer\matroskaDemuxer.cpp:1943:5: note: Taking true branch
if ((res = ebml_read_master(&id)) < 0)
^
C:\Users\jcder\Source\Repos\tsMuxer-master\tsMuxer\matroskaDemuxer.cpp:1944:16: note: Potential leak of memory pointed to by 'track'
return res;
myself not real programmer, so I can't say if this warning real / harmful or false.