jpegparse: fix endianness

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5838>
This commit is contained in:
Víctor Manuel Jáquez Leal 2023-12-20 21:34:29 +01:00
parent 470b90a14a
commit ae55ebfdf2

View file

@ -464,11 +464,19 @@ gst_jpeg_parse_app0 (GstJpegParse * parse, GstJpegSegment * seg)
return FALSE;
/* x density */
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
if (!gst_byte_reader_get_uint16_le (&reader, &xd))
return FALSE;
/* y density */
if (!gst_byte_reader_get_uint16_le (&reader, &yd))
return FALSE;
#else
if (!gst_byte_reader_get_uint16_be (&reader, &xd))
return FALSE;
/* y density */
if (!gst_byte_reader_get_uint16_be (&reader, &yd))
return FALSE;
#endif
/* x thumbnail */
if (!gst_byte_reader_get_uint8 (&reader, &xt))