CCExtractor / ccextractor

CCExtractor - Official version maintained by the core team
https://www.ccextractor.org
GNU General Public License v2.0
721 stars 426 forks source link

**[FIX]** fix infinite loop in MP4 file type detector and processor #1566

Closed xopok closed 10 months ago

xopok commented 1 year ago

On bad inputs containing e.g. the following sequence of bytes within the first 1MiB "ff ff ff ff 6d 65 74 61" detect_stream_type was executing an infinite loop because "ff ff ff ff" was interpreted as a length of the candidate "meta" MP4 box, caused the size_t overflow inside isValidMP4Box which pointed nextBoxLocation to the previous byte and the execution flow processed the same "meta" again.

In raising this pull request, I confirm the following (please check boxes):

My familiarity with the project is as follows (check one):


{pull request content here}

ccextractor-bot commented 1 year ago

CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results:

Report Name Tests Passed
Broken 13/13
CEA-708 2/14
DVB 4/7
DVD 3/3
DVR-MS 2/2
General 24/27
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 85/87
Teletext 21/21
WTV 13/13
XDS 31/34

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:


Check the result page for more info.

ccextractor-bot commented 1 year ago

CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results:

Report Name Tests Passed
Broken 13/13
CEA-708 2/14
DVB 4/7
DVD 3/3
DVR-MS 2/2
General 24/27
Hauppage 3/3
MP4 2/3
NoCC 10/10
Options 82/87
Teletext 21/21
WTV 0/13
XDS 26/34

It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Your PR breaks these cases:


Check the result page for more info.

xopok commented 1 year ago

This is actually a more robust fix to https://github.com/CCExtractor/ccextractor/issues/1421. Tests failures look very unrelated.

cfsmp3 commented 1 year ago

It seems sane to me @canihavesomecoffee but I think you're the last one playing with the mp4 stuff? I don't remember :-)

xopok commented 10 months ago

Is there anything blocking this pull request from being merged?

canihavesomecoffee commented 10 months ago

I don't remember why I didn't leave a review, but it looks good to me as well.