From 3c915cdca4b79bba1ad4905c5d72bd9c13018efa Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 23 Mar 2023 16:40:54 +0000 Subject: [PATCH] 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: --- subprojects/gst-plugins-good/gst/rtp/gstrtpjpegdepay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-good/gst/rtp/gstrtpjpegdepay.c b/subprojects/gst-plugins-good/gst/rtp/gstrtpjpegdepay.c index 02209d5..b85b7fb 100644 --- a/subprojects/gst-plugins-good/gst/rtp/gstrtpjpegdepay.c +++ b/subprojects/gst-plugins-good/gst/rtp/gstrtpjpegdepay.c @@ -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 */ -- 2.7.4