Found segfault in slice_segment_header with fuzzing. Following is the call stack:

> #0  0x00007ffff166df7b in slice_segment_header::operator= (this=0x61b000000e80)
>     at ../libde265/slice.h:130
> #1  0x00007ffff15f7dd9 in slice_segment_header::read (this=0x61b000000e80, br=0x7fffffffcb80,
>     ctx=0x621000002900, continueDecoding=0x7fffffffc9e0) at slice.cc:416
> #2  0x00007ffff139109c in decoder_context::read_slice_NAL (this=0x621000002900, reader=...,
>     nal=0x606000000800, nal_hdr=...) at decctx.cc:626
> #3  0x00007ffff13ae55a in decoder_context::decode_NAL (this=<optimized out>, nal=<optimized out>)
>     at decctx.cc:1230
> #4  0x00007ffff13b0b3f in decoder_context::decode (this=<optimized out>, more=0x7fffffffcdf0)
>     at decctx.cc:1318
> #5  0x00007ffff132723c in de265_decode (de265ctx=0x621000002900, more=0x7fffffffcdf0) at de265.cc:352
> #6  0x00007ffff3de0c77 in libde265_v1_decode_image (decoder_raw=<optimized out>,
>     out_img=0x7fffffffd200) at heif_decoder_libde265.cc:313
> #7  0x00007ffff3befc88 in heif::HeifContext::decode_image_planar (this=0x611000000050, ID=4294955184,
>     img=std::shared_ptr<heif::HeifPixelImage> (empty) = {...}, out_colorspace=heif_colorspace_RGB,
>     options=0x0) at heif_context.cc:1090
> #8  0x00007ffff3be7d63 in heif::HeifContext::decode_image_user (this=0x611000000050, ID=1, img=...,
>     out_colorspace=heif_colorspace_RGB, out_chroma=heif_chroma_interleaved_RGBA, options=0x1)
>     at heif_context.cc:1003

can send poc files over email. Please contact me.
Segmentation fault in slice_segment_header
This is a GitHub Issue
repo:libde265
owner:strukturag
Title : Segmentation fault in slice_segment_header
Issue date:

--- start body ---
Found segfault in slice_segment_header with fuzzing. Following is the call stack:

> #0  0x00007ffff166df7b in slice_segment_header::operator= (this=0x61b000000e80)
>     at ../libde265/slice.h:130
> #1  0x00007ffff15f7dd9 in slice_segment_header::read (this=0x61b000000e80, br=0x7fffffffcb80,
>     ctx=0x621000002900, continueDecoding=0x7fffffffc9e0) at slice.cc:416
> #2  0x00007ffff139109c in decoder_context::read_slice_NAL (this=0x621000002900, reader=...,
>     nal=0x606000000800, nal_hdr=...) at decctx.cc:626
> #3  0x00007ffff13ae55a in decoder_context::decode_NAL (this=<optimized out>, nal=<optimized out>)
>     at decctx.cc:1230
> #4  0x00007ffff13b0b3f in decoder_context::decode (this=<optimized out>, more=0x7fffffffcdf0)
>     at decctx.cc:1318
> #5  0x00007ffff132723c in de265_decode (de265ctx=0x621000002900, more=0x7fffffffcdf0) at de265.cc:352
> #6  0x00007ffff3de0c77 in libde265_v1_decode_image (decoder_raw=<optimized out>,
>     out_img=0x7fffffffd200) at heif_decoder_libde265.cc:313
> #7  0x00007ffff3befc88 in heif::HeifContext::decode_image_planar (this=0x611000000050, ID=4294955184,
>     img=std::shared_ptr<heif::HeifPixelImage> (empty) = {...}, out_colorspace=heif_colorspace_RGB,
>     options=0x0) at heif_context.cc:1090
> #8  0x00007ffff3be7d63 in heif::HeifContext::decode_image_user (this=0x611000000050, ID=1, img=...,
>     out_colorspace=heif_colorspace_RGB, out_chroma=heif_chroma_interleaved_RGBA, options=0x1)
>     at heif_context.cc:1003

can send poc files over email. Please contact me.
--- end body ---

A segmentation fault in the slice_segment_header function of libde265 indicates a potential vulnerability that could be exploited to cause a Denial of Service (DoS) through crafted input, particularly when handling NAL units in video decoding. This issue arises during the reading of slice segment headers, which may lead to memory corruption or crashes when processing malformed data.