jpegdec: Fix incorrect logic in EOI tag detection
authorScott Kanowitz <skanowitz@echo360.com>
Thu, 12 Sep 2019 19:21:24 +0000 (15:21 -0400)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 18 Nov 2019 00:22:45 +0000 (00:22 +0000)
This change fixes the reversed logic in the EOI tag detection
code.

ext/jpeg/gstjpegdec.c

index bcbad7a..5442168 100644 (file)
@@ -1208,7 +1208,7 @@ gst_jpeg_dec_handle_frame (GstVideoDecoder * bdec, GstVideoCodecFrame * frame)
 
   data = dec->current_frame_map.data;
   nbytes = dec->current_frame_map.size;
-  has_eoi = ((data[nbytes - 2] != 0xff) || (data[nbytes - 1] != 0xd9));
+  has_eoi = ((data[nbytes - 2] == 0xff) && (data[nbytes - 1] == 0xd9));
 
   /* some cameras fail to send an end-of-image marker (EOI),
    * add it if that is the case. */