From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 1287B4C009 for ; Sat, 6 Dec 2025 22:05:26 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'51tVv0ZESjVPb1FFhNSPx4rGoB8edSI+BVph4RKthVs=', expected b'f+OuuT3RATe9ynAwu53dAqUeOKExB/aXQQ5BNBvOn5M=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1765058714; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=51tVv0ZESjVPb1FFhNSPx4rGoB8edSI+BVph4RKthVs=; b=FyZ1ntvM+FvTrfPBlrpOcFOz5Q8U7n9wpImlqjBrOWraeU3wjHRrTAwNFbuqakvjRqkEO vaz9S6SwZA71eBmtxTKuwRGACuTxTb/Mx5CBk3ezeZf1Tsvc/gpUQkcNOIa0LIR6djalI66 ztGjqsy/5Itk6SI0Sbj6cCoXvBeln/H2T7Wf/6oCD/IgIINtMKbM3pj8ItdypUeTio80Fd3 r47NXC1zQD8NszLJzyWLcwetWbhQYBnEMEskStX2nhYkU4+cja21yVCzbMjk3Rdu//PkoYH UPn4vUodUveR6jhtVtg2G798KYPgJau4lSNM6Z8TwJd5/DDBLtQrbZErsH3A== Received: from [172.19.0.3] (unknown [172.19.0.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 43F426905B9; Sun, 7 Dec 2025 00:05:14 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1765058698; b=mZKORuIw2zfy6gqD6qUYxVXmFr982pd9U8/dp0ncb35b5vZ3lX32GHNQY/eCCQo/3aDOY wA93cQy69W6ZefmBH+cnwfgU7B1llwa+R7NMyZcxQannbArpQhA9ZbcN8+ICWO1noeXKUYq 6KCTdog9gTSVpJENbELgWeI7J3ckuO3jGs8pi9WP5wdRE3IkrPueDOhczXClfAh7yUN1ePz 90Bowi43CLTQUVMzCZ/xafJ7zsOKe/C5X8aI59kpum44lcb6IDUydVOFUSy1CuD2TQc7qnX yTifYD6bazPohiuxD50NWCP8WKGb/DPHWuhNcwq9ReeKGOXxTUnjUicNuX1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1765058698; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=ADCpZmORtGkoMu2U44hIICiF/epAbxesQWDusL7H1cI=; b=j94vnzFIGqbJbDV3KUjC6xa3WG8RiV4WuIQGw40qp99VWYIfpprGcaxgQiNHd15IxjEL9 P46xlglqJXTg5rk5EyF2b+Cm3YbkHggZjufskoz5eBm7jXKRkTVhf4JZf6+CHdm742XBtCL 4c/c3sCaLWsKKHnKxeGw2LVOnK0y5u9iWPlU89saA+cfxTAKfY0brFSci5j8U+ZoypAwrek J5xeHBlasxVwT5Q3RfCnJ7M8i3iPBimfjkW7dG1b1jU+A2n1g8/xclxOhUe+/XrYRwveHAJ EWe+7H33cPO4HXWgH6PEZSA/f3TOZvhbDZy+YtpuCWilmlYZUYqYMjApp2+w== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1765058688; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=f+OuuT3RATe9ynAwu53dAqUeOKExB/aXQQ5BNBvOn5M=; b=JxdofByrzBr6VKeQBDyMRLVR/Otr2QtVndQZ/bBgtUyo9X5o/7qT+Usm5r2YKT26iUVS0 GHolvBDIY1H9uGwz9FMhw3yvYrq3ND77yPSEWS/cmfCoe3/AJV4uFl9UWj+TIMQGPZ5EOSo bZhh78tWOeCgWGqHwR75TWnVKtk3M8dCwe+t1sZanWVLcGqPQwKNm5d4hjfvrI1/hQOdvHi UScfaoLJvf3CjafhfoGvRjEvHs3QwFHRpSE6OBpX6A/ihUzjGBYjkE2K3n7GbZ/GftStjYr 8NG83uqirePi92aXKh5zjmbT43tv1OWlHYma3aSJnc3NcUTUvoFRNxYY9Rmg== Received: from 55ca25703178 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 2B8E368FB4D for ; Sun, 7 Dec 2025 00:04:48 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Sat, 06 Dec 2025 22:04:47 -0000 Message-ID: <176505868834.39.6336554598166305350@2cb04c0e5124> Message-ID-Hash: FRQW7OZ3HP6COHRS4IDEPUFPGPOV25NF X-Message-ID-Hash: FRQW7OZ3HP6COHRS4IDEPUFPGPOV25NF X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits (PR #21117) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Valerii Zapodovnikov via ffmpeg-devel Cc: Valerii Zapodovnikov Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21117 opened by Valerii Zapodovnikov (Balling) URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21117 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21117.patch Mantissas are the last data in the channel subsegment and it appears it is sometimes missing a very few bits for the parsing to complete. This must not be confused with data corruption. In standard conditions with certified products, it has been observed that the occurence of this issue is pretty steady and about once every 2 hours. The truncation is at about 950 out of the 1024 values (923 is the minimum I have seen so far). The current code raises a severe 'Read past end' error and all data is lost resulting in 20ms(@25fps) of silence for the affected channel. This patch introduces a tolerance: if 800 out of the 1024 mantissas have been parsed, a simple warning is raised and the data is preserved. Signed-off-by: Nicolas Gaullier >>From 9a2d58d52c46d4d259cda5ad276b5de9f6bff4f6 Mon Sep 17 00:00:00 2001 From: Nicolas Gaullier Date: Sun, 7 Dec 2025 01:02:41 +0300 Subject: [PATCH] avcodec/dolby_e: Add error recovery when parse_mantissas run out of bits Mantissas are the last data in the channel subsegment and it appears it is sometimes missing a very few bits for the parsing to complete. This must not be confused with data corruption. In standard conditions with certified products, it has been observed that the occurence of this issue is pretty steady and about once every 2 hours. The truncation is at about 950 out of the 1024 values (923 is the minimum I have seen so far). The current code raises a severe 'Read past end' error and all data is lost resulting in 20ms(@25fps) of silence for the affected channel. This patch introduces a tolerance: if 800 out of the 1024 mantissas have been parsed, a simple warning is raised and the data is preserved. Signed-off-by: Nicolas Gaullier --- libavcodec/dolby_e.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libavcodec/dolby_e.c b/libavcodec/dolby_e.c index bbcb747c06..5f4ccc0478 100644 --- a/libavcodec/dolby_e.c +++ b/libavcodec/dolby_e.c @@ -845,6 +845,7 @@ static int parse_indices(DBEContext *s, DBEChannel *c) return 0; } +#define MIN_MANTISSAS 800 static int parse_mantissas(DBEContext *s, DBEChannel *c) { DBEGroup *g; @@ -885,6 +886,13 @@ static int parse_mantissas(DBEContext *s, DBEChannel *c) } } } else { + if (i == c->nb_groups - 1 + && count * size1 > get_bits_left(&s->gb) + && get_bits_left(&s->gb) >= 0 + && (int)(mnt - c->mantissas) >= MIN_MANTISSAS) { + av_log(s->avctx, AV_LOG_WARNING, "Truncated mantissas @%d, highest frequencies not recoverable\n", (int)(mnt - c->mantissas)); + break; + } for (k = 0; k < count; k++) mnt[k] = get_sbits(&s->gb, size1) * scale; } -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org