From 1ac4cf7f52c30dcd0768e10d54f4f822a95bbff8 Mon Sep 17 00:00:00 2001 From: jeffqjiangNew <142832361+jeffqjiangNew@users.noreply.github.com> Date: Tue, 14 May 2024 14:07:23 -0400 Subject: [PATCH] * rocDecode/HEVC: Added error handling for the cases where there is no slice data in the decode payload. (#354) --- src/parser/hevc_parser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/parser/hevc_parser.cpp b/src/parser/hevc_parser.cpp index 0ded8882be..21b8b5d6d2 100644 --- a/src/parser/hevc_parser.cpp +++ b/src/parser/hevc_parser.cpp @@ -99,6 +99,11 @@ rocDecStatus HevcVideoParser::ParseVideoData(RocdecSourceDataPacket *p_data) { SendSeiMsgPayload(); } + // Error handling: if there is no slice data, return gracefully. + if (num_slices_ == 0) { + return ROCDEC_SUCCESS; + } + // Decode the picture if (SendPicForDecode() != PARSER_OK) { ERR(STR("Failed to decode!"));