Skip to content

Report decoder output stride/slice_height via get_output_info - #139

Open
Michal-Szczepaniak wants to merge 1 commit into
sailfishos:masterfrom
Michal-Szczepaniak:fix/decoder-stride-slice-height
Open

Report decoder output stride/slice_height via get_output_info#139
Michal-Szczepaniak wants to merge 1 commit into
sailfishos:masterfrom
Michal-Szczepaniak:fix/decoder-stride-slice-height

Conversation

@Michal-Szczepaniak

@Michal-Szczepaniak Michal-Szczepaniak commented Aug 19, 2026

Copy link
Copy Markdown

For the raw (non-gralloc) decoder data path, gst-droid has to guess the row stride and padded slice height of the output buffer using hardcoded per-colour-format alignment constants, since droid_media_codec_get_output_info never exposed the values the underlying codec actually used. When a device's decoder output doesn't match the guessed alignment, gst-droid reads/writes out of bounds.

stagefright already surfaces kKeyStride/kKeySliceHeight in the codec's output format when available; forward them through DroidMediaCodecMetaData so consumers no longer have to guess.

Have in mind the fix has been written by LLM as has been above message. This fixes crash in gst-droid when using qmlglsink.

Corresponding gst-droid fix sailfishos/gst-droid#87

(gdb) bt
#0  gst_droidvec_copy_packed_planes (height=540, width=960, stride_in=1920, in=0x7f7e206d90 "", stride_out=960, out1=0x7f7c5a7c58 "", out0=0x7f7c529358 "") at ../gst/droidcodec/gstdroidvdec.c:126
#1  gst_droidvdec_convert_yuv420_packed_semi_planar_to_i420 (dec=<optimized out>, out=0x7f7eb83648, in=<optimized out>, info=0x7f64000e98, width=<optimized out>, height=<optimized out>) at ../gst/droidcodec/gstdroidvdec.c:271
#2  0x0000007ff0cc0488 in gst_droidvdec_convert_buffer (info=0x7f64000e98, in=0x7f7eb836b8, out=0x7f6400c0e0, dec=0x7fc40a6df0 [GstDroidVDec]) at ../gst/droidcodec/gstdroidvdec.c:457
#3  gst_droidvdec_data_available (data=0x7fc40a6df0, encoded=0x7f7eb836b8) at ../gst/droidcodec/gstdroidvdec.c:608
#4  0x0000007fae1308cc in  ()
#5  0x0000007fc40a6df0 in  ()
#6  0x0000007fc40a48e0 in  ()

For the raw (non-gralloc) decoder data path, gst-droid has to guess the
row stride and padded slice height of the output buffer using hardcoded
per-colour-format alignment constants, since droid_media_codec_get_output_info
never exposed the values the underlying codec actually used. When a
device's decoder output doesn't match the guessed alignment, gst-droid
reads/writes out of bounds.

stagefright already surfaces kKeyStride/kKeySliceHeight in the codec's
output format when available; forward them through DroidMediaCodecMetaData
so consumers no longer have to guess.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants