Spinlogic / AMR-WB_extractor

Extracts AMR / AMR-WB frames from RTP inside PCAP files and builds a .amr file that complies with the storage format in RFC4867
MIT License
14 stars 12 forks source link

List index out of range after ft >> 7 in line 89 (ft becomes 15, thats > 9) #2

Closed kosumosuSpb closed 4 months ago

kosumosuSpb commented 1 year ago

Hi!

I noticed, that on some files script crushes with this:

Number of packets read from pcap: 518
AMR samples: 0, AMR-WB samples: 100, EVS samples: 0
Traceback (most recent call last):
  File "./pcap_parser.py", line 384, in <module>
    storePayloadIetf(ofile, codec, rtp.load)
  File "./pcap_parser.py", line 89, in storePayloadIetf
    if len(buf) >= codec_ft[ft]:    # remove padding
IndexError: list index out of range

it happens because after ft = ft >> 7 ft becomes > 9 (15)

I dont know actually how extractor works exactly, can anyone help? :)

kosumosuSpb commented 1 year ago

I found that its happens with files that has 74 byte == 21-24. If their == f1 or f4 - everything is ok

Spinlogic commented 4 months ago

nothing to fix, looks like.