From 0fd9c0586b894ddf8b5d2e5edcdd9539b8b18725 Mon Sep 17 00:00:00 2001 From: Jeff Jiang <142832361+jeffqjiangNew@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:27:46 -0500 Subject: [PATCH] rocdecdecode sample: Fixed the crash issue on AVC streams. (#688) * * rocDecode/rocdecdecode sample: Fixed the crash issue on AVC streams. - We need to set bit depth to 8 when creating the initial decoder. This allows all codec types to be accommodated. Other bit depths can be supported in decoder reconfig later. * * rocDecode/rocdecdecode sample: Changed program stop from harsh abort to graceful exit, when critial error occurs. * * rocDecode/rocdecdecode sample: Minor change based on review comment. [ROCm/rocdecode commit: 4cf1a48d8203da1383b7d0fe6f8632b51ec647a7] --- projects/rocdecode/samples/rocdecDecode/rocdecdecode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocdecode/samples/rocdecDecode/rocdecdecode.cpp b/projects/rocdecode/samples/rocdecDecode/rocdecdecode.cpp index 99927537b9..e2e52532e9 100644 --- a/projects/rocdecode/samples/rocdecDecode/rocdecdecode.cpp +++ b/projects/rocdecode/samples/rocdecDecode/rocdecdecode.cpp @@ -65,7 +65,7 @@ __attribute__((visibility("hidden"))) inline void report_error( << file_name << ":" << line) << ... << std::forward(args)) << std::endl; - std::abort(); + std::exit(EXIT_FAILURE); } //hardcoding for this sample @@ -362,7 +362,7 @@ void create_decoder(DecoderInfo& dec_info) { // this will get changed in reconfigure when the sequence header is parsed from the stream to detect the actual video parameters create_info.chroma_format = rocDecVideoChromaFormat_420; create_info.output_format = rocDecVideoSurfaceFormat_NV12; - create_info.bit_depth_minus_8 = 2; + create_info.bit_depth_minus_8 = 0; create_info.num_output_surfaces = 1; CHECK(rocDecCreateDecoder(&dec_info.decoder, &create_info)); }