rtpjpegdepay: fix logic error when checking if an EOI is present

We wouldn't add the missing EOI marker if the frame ended with
either 0xFF NN or 0xNN D9.

Fixes #2407

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4271>
This commit is contained in:
Tim-Philipp Müller 2023-03-23 16:40:54 +00:00 committed by GStreamer Marge Bot
parent c2b912ce74
commit de5ebc31fc

View file

@ -705,7 +705,7 @@ gst_rtp_jpeg_depay_process (GstRTPBaseDepayload * depayload, GstRTPBuffer * rtp)
* marker */
gst_adapter_copy (rtpjpegdepay->adapter, end, avail - 2, 2);
if (end[0] != 0xff && end[1] != 0xd9) {
if (GST_READ_UINT16_BE (end) != 0xffd9) {
GST_DEBUG_OBJECT (rtpjpegdepay, "no EOI marker, adding one");
/* no EOI marker, add one */