Invalid reads and use of uninitialized value when remuxing misdetected file
Hello,
I have uploaded GallatinForest.com2.ivr to your server. It is misdetected as mpeg-2 elementary stream and there are lots of invalid reads/uses of uninitialized values when remuxing it:
==22448== Memcheck, a memory error detector
==22448== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==22448== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info
==22448== Command: mkvmerge -o out.mkv GallatinForest.com2.ivr
==22448==
mkvmerge v41.0.0 ('Smarra') 64-bit
'GallatinForest.com2.ivr': Using the demultiplexer for the format 'MPEG-1/2 video elementary stream'.
'GallatinForest.com2.ivr' track 0: Using the output module for the format 'MPEG-1/2 video'.
The file 'out.mkv' has been opened for writing.
Warning: Found at least one B frame without second reference in a non closed GOP.
==22448== Invalid read of size 1
==22448== at 0x519A73: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51899F: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Address 0x96ae445 is 0 bytes after a block of size 5 alloc'd
==22448== at 0x48394DF: operator new[](unsigned long) (vg_replace_malloc.c:423)
==22448== by 0x519717: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CA4: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Invalid read of size 1
==22448== at 0x519A87: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51899F: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Address 0x96ae445 is 0 bytes after a block of size 5 alloc'd
==22448== at 0x48394DF: operator new[](unsigned long) (vg_replace_malloc.c:423)
==22448== by 0x519717: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CA4: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Invalid read of size 1
==22448== at 0x519A6F: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51899F: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Address 0x96aebe4 is 0 bytes after a block of size 4 alloc'd
==22448== at 0x48394DF: operator new[](unsigned long) (vg_replace_malloc.c:423)
==22448== by 0x519717: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CA4: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Conditional jump or move depends on uninitialised value(s)
==22448== at 0x3840EC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38524D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Uninitialised value was created by a heap allocation
==22448== at 0x483874F: malloc (vg_replace_malloc.c:299)
==22448== by 0x43A439: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51853A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518A95: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Conditional jump or move depends on uninitialised value(s)
==22448== at 0x3840A1: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38524D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Conditional jump or move depends on uninitialised value(s)
==22448== at 0x384592: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38524D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Uninitialised value was created by a heap allocation
==22448== at 0x483874F: malloc (vg_replace_malloc.c:299)
==22448== by 0x43A439: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51853A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518A95: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Conditional jump or move depends on uninitialised value(s)
==22448== at 0x3840AF: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38524D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Uninitialised value was created by a heap allocation
==22448== at 0x483874F: malloc (vg_replace_malloc.c:299)
==22448== by 0x43A439: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51853A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518A95: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Conditional jump or move depends on uninitialised value(s)
==22448== at 0x3843E8: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38524D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
==22448== Conditional jump or move depends on uninitialised value(s)
==22448== at 0x383A4E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x3843C1: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38524D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Uninitialised value was created by a heap allocation
==22448== at 0x483874F: malloc (vg_replace_malloc.c:299)
==22448== by 0x43A439: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51853A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518A95: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
Progress: 100%
The cue entries (the index) are being written...
==22448== Syscall param write(buf) points to uninitialised byte(s)
==22448== at 0x52F9024: write (write.c:26)
==22448== by 0x527A4FC: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1188)
==22448== by 0x527ACAE: new_do_write (fileops.c:456)
==22448== by 0x527ACAE: _IO_new_file_xsputn (fileops.c:1262)
==22448== by 0x527ACAE: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1204)
==22448== by 0x526ED97: fwrite (iofwrite.c:39)
==22448== by 0x4949D0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x44929F: ??? (in /usr/bin/mkvmerge)
==22448== by 0x4494D9: ??? (in /usr/bin/mkvmerge)
==22448== by 0x43C273: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25864C: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26EB3D: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6DA: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Address 0x97e5fa9 is 380,777 bytes inside a block of size 20,971,520 alloc'd
==22448== at 0x483874F: malloc (vg_replace_malloc.c:299)
==22448== by 0x43A439: ??? (in /usr/bin/mkvmerge)
==22448== by 0x448FD0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x44915E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26D400: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6C7: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448== Uninitialised value was created by a heap allocation
==22448== at 0x483874F: malloc (vg_replace_malloc.c:299)
==22448== by 0x43A439: ??? (in /usr/bin/mkvmerge)
==22448== by 0x51853A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518A95: ??? (in /usr/bin/mkvmerge)
==22448== by 0x518CE0: ??? (in /usr/bin/mkvmerge)
==22448== by 0x384FD3: ??? (in /usr/bin/mkvmerge)
==22448== by 0x38384E: ??? (in /usr/bin/mkvmerge)
==22448== by 0x2DF5BC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x25AC1A: ??? (in /usr/bin/mkvmerge)
==22448== by 0x26B055: ??? (in /usr/bin/mkvmerge)
==22448== by 0x1ED6CC: ??? (in /usr/bin/mkvmerge)
==22448== by 0x5212B6A: (below main) (libc-start.c:308)
==22448==
Multiplexing took 14 seconds.
==22448==
==22448== HEAP SUMMARY:
==22448== in use at exit: 1,233 bytes in 11 blocks
==22448== total heap usage: 954,641 allocs, 954,630 frees, 13,705,313,357 bytes allocated
==22448==
==22448== LEAK SUMMARY:
==22448== definitely lost: 0 bytes in 0 blocks
==22448== indirectly lost: 0 bytes in 0 blocks
==22448== possibly lost: 0 bytes in 0 blocks
==22448== still reachable: 1,233 bytes in 11 blocks
==22448== suppressed: 0 bytes in 0 blocks
==22448== Rerun with --leak-check=full to see details of leaked memory
==22448==
==22448== For counts of detected and suppressed errors, rerun with: -v
==22448== ERROR SUMMARY: 10781 errors from 10 contexts (suppressed: 0 from 0)
Moreover, 13 GB allocated for a file of only 3.5 MB seems to be a bit much.
Gruß Andreas
Edited by mkver