ccconverter: integer overflow & crashing
I updated from 1.20.3 to 1.22.0 and now my application crashes after playing a decklink SDI source with 608/708 captions and a non-integer framerate for a long time. I'm only testing SDI sources here, but I'm guessing any file with closed captions that is long enough will have the same issue. The pipeline runtime seems to depend on the framerate. It also seems to run longer when closed captions are intermittent. The following numbers are with sources that should have continuous closed captions.
- 1080i59.94 or 720p59.94 with 608/708 captions: crashes around 597 minutes
- 1080p29.97 with 608/708 captions: crashes around 1194 minutes
- 720p60 with 608/708 captions: never crashes (quit testing after about 70 hours)
- any SDI source without captions: never crashes
# Note: change the caption framerate to match the SDI input framerate
time GST_DEBUG="3" gst-launch-1.0 decklinkvideosrc output-cc=true drop-no-signal-frames=true connection=sdi device-number=0 ! queue ! ccextractor name=cc ! queue ! cccombiner name=co ! queue ! fakesink cc.caption ! queue ! ccconverter ! 'closedcaption/x-cea-708,format=cc_data,framerate=60000/1001' ! queue ! co.caption
...
...
ERROR:../subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c:1452:can_generate_output: code should not be reached
Bail out! ERROR:../subprojects/gst-plugins-bad/ext/closedcaption/gstccconverter.c:1452:can_generate_output: code should not be reached
real 596m48.102s
Counting frames for the runtime of that pipeline is very similar to i32 max / 1000.
1194 * 60 * 29.97 = 2147050.8
597 * 60 * 59.94 = 2147050.8