Skip to content
Snippets Groups Projects

jpegparse: fix incorrect reading of transform in app14 marker

Merged HuQian requested to merge HuQian/gstreamer:dev-jpegparseycck into main
All threads resolved!

"adobe" in app14 marker seem not a null-terminted string. so, when we use gst_byte_reader_get_string_utf8, more bytes will be read until null. and "gst_byte_reader_get_uint8 (&reader, &transform)" will almost fail to read transform

this is my test file, and i find jpegparse consider it is CMYK, but YCCK by libjpeg-turbo

320x240_120ppi_square_baseline_q0

image

and from source code, ffmpeg/libjpeg-turbo seem do not consider "Adobe" a null-terminated string.

ffmpeg parsing app14 flow:

https://github.com/FFmpeg/FFmpeg/blob/654bd47716c4f36719fb0f3f7fd8386d5ed0b916/libavcodec/mjpegdec.c#L1933

https://github.com/FFmpeg/FFmpeg/commit/0f31d401c35c6d39462c2b3e2aa7b573db0ccfde

libjpeg-turbo emit jpeg app14:

https://github.com/libjpeg-turbo/libjpeg-turbo/blob/b4336c3afb575d4390365a1be0f7dbabb0cc5161/jcmarker.c#L390

but this PDF consider it is null-terminted

https://www.itu.int/rec/T-REC-T.872-201206-I/en

Edited by HuQian

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • HuQian added 1 commit

    added 1 commit

    • 998660f6 - jpegparse: fix incorrect reading of transform in app14 marker

    Compare with previous version

  • Víctor Manuel Jáquez Leal approved this merge request

    approved this merge request

  • resolved all threads

  • added 11 commits

    Compare with previous version

  • changed milestone to %1.25.1

  • Please register or sign in to reply
    Loading