vpxenc: fix crash if encoder produces unmatching ts
authorGuillaume Desmottes <guillaume.desmottes@onestream.live>
Wed, 11 May 2022 13:18:42 +0000 (15:18 +0200)
committerGuillaume Desmottes <guillaume.desmottes@onestream.live>
Thu, 12 May 2022 11:00:53 +0000 (13:00 +0200)
commit1e829696e83bab49cae120f81c326d7a3a84f84a
tree76451233ae122f8bdbd88810c246432bec6c661d
parent7ac4dd3d9d763a58bfff01bc771e1df9e466195f
vpxenc: fix crash if encoder produces unmatching ts

If for some reason the encoder produces frames with a pts higher than
the input one, we were dropping all the video encoder frames and ended
up crashing when trying to access the pts of a NULL pointer returned by
gst_video_encoder_get_oldest_frame().

I hit this scenario by feeding a decreasing timestamp to vp8enc which
seem to confuse the encoder.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2405>
subprojects/gst-plugins-good/ext/vpx/gstvpxenc.c