From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4BBED40333 for ; Tue, 18 Jul 2023 21:46:01 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 21CF868C570; Wed, 19 Jul 2023 00:45:53 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8CF3568C206 for ; Wed, 19 Jul 2023 00:45:45 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id C18861C0002 for ; Tue, 18 Jul 2023 21:45:44 +0000 (UTC) From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 18 Jul 2023 23:45:30 +0200 Message-Id: <20230718214542.685375-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230718214542.685375-1-michael@niedermayer.cc> References: <20230718214542.685375-1-michael@niedermayer.cc> MIME-Version: 1.0 X-GND-Sasl: michael@niedermayer.cc Subject: [FFmpeg-devel] [PATCH 02/14] avradio/sdrdemux: Fix corner case in snap2band X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: Michael Niedermayer --- libavradio/sdrdemux.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavradio/sdrdemux.c b/libavradio/sdrdemux.c index 318b5465da..6b1553b130 100644 --- a/libavradio/sdrdemux.c +++ b/libavradio/sdrdemux.c @@ -1368,6 +1368,8 @@ static int64_t snap2band(SDRContext *sdr, int64_t wanted_freq, int64_t delta) { min_center_freq += sdr->bandwidth / 2; max_center_freq -= sdr->bandwidth / 2; } + min_center_freq = av_clip64(min_center_freq, sdr->min_center_freq, sdr->max_center_freq); + max_center_freq = av_clip64(max_center_freq, sdr->min_center_freq, sdr->max_center_freq); // Is the band in the direction we want to seek to ? if (FFSIGN(min_center_freq - wanted_freq) == FFSIGN(max_center_freq - wanted_freq)) -- 2.31.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".