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 73C7E4EA47 for ; Tue, 10 Feb 2026 23:50:10 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'53+2jEMlwp5tdKCXOozAR5D3v414oQtOfZsGobd1eFg=', expected b'p6ZoQYO/gheEyX4rrzCCvCAGoactH9xze7iU5IhexpA=')) 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=1770767396; 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=53+2jEMlwp5tdKCXOozAR5D3v414oQtOfZsGobd1eFg=; b=3pG8SzpvVWmC6hHTeoLtrfbHYRedK4uOXUl1q59WP0q2xBm8nR482Z/JakY6xlbXcqDv9 n1Yw2tf6/VUemcE2r5XqzWjt7y3KRRKD+HrITnTeE2QWcyIMrsoIJAxlENcaBGjWV462GfQ J3HxlEdmnuGoLktHttO2h5+MeK0pl8i4AMho1p6/V/FQdA01+xPVoZo3zBKCegK84CiFJq1 EfKZQqfgAesDvNLg6ik9FOoINpkczY1GdQHSDh7i4UXpx7Fh5cOOPVnMFOFqjsg0f/rmxPj vTOh5dRTLfGP9XgnxzS19iaVSOllEiShhWBWUzujLvFObaSs1/mKjQFuj00A== Received: from [172.20.0.3] (unknown [172.20.0.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 3D8F4691672; Wed, 11 Feb 2026 01:49:56 +0200 (EET) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1770767388; b=RiM7MpyU2IUOBXucXwKj3eWsM2rCzC/K+nq4+6/l1iuyWBxwJsh6+91NQ0LTNO/awcObS d30uJIFTP7Y1w9WhSGNTaq+vO9dqu0wb+SghINaZ+f2cNBJkMZicvNhuZ+D6UWFUs5ENkk7 h8UiF0Nag1vnN8rxSxlXWsfboLRQoPs5Fvc8bltZ8DvyJ8GWzSce+M2tiS8nVHU0DjrUdkF SpQbhKMLMQJvDjJlmODecOOSE/FfG9JSiLgbBvH0Irz5RjbJ03QqHLP9fwebm+bBn/G26AU ikAoYIpQOHLR7hT1TXfLPXXaha50+2UXD916CuF8nHo146jmcYz/f7FwVJ6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1770767388; 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=kWoUUpM1n0DS+ac1wguseuakA/k3ck0x/l0S3LxXdZ0=; b=T37pOdXqhcaKMniJahl7krNpmc1Ad7kTbFBF89+nWT6M3NNNQ5dQkwSgYKf18uC6qS92G ZUZ4+dK0NodrnILlFGEuH7MViWmhLuJq8BqBInt81ERulNw17VtsHH5i9dGKEDqAHQHzgAb hPL0nakIAVGQsDRoYmUNmG1opBZ36LejA2sbkf4SgrFz9wwwidajE9FOl2mJblQmC8Aj+0f 5hbQz/fSY4HSrSxSTMMLjJNFyES4TaOxzGA04FZHZG2dvq0f9A+pAM5dksV3Zp6ysX+rI+U B2ErhisNVZd9bkxXOJE4VKnXbuvIJ0HBXJIo4O7+mz1vToBVTWJ++lv3kFJw== 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=1770766919; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=p6ZoQYO/gheEyX4rrzCCvCAGoactH9xze7iU5IhexpA=; b=GaTsw6IwLB8y3RAMone8sBMYk7extucykbIp4WegSYKLvu2WkYl1ve7HHmk5/9eaKy92h KoJDTedWS91TFOwPVzkmYjEvvlYya4tIKDxhFRioci2JwEcUS8eF0A+S5AtPHyOKUKA4HRz cwIF1xc9qYwkcNmEHIXwSnkXmc0P1IJRddM3CD0bMIemAzKN9baFW4XYDGsnpkiJFSMNxBq BFMz/77/Z7f8iwE6Q+QtFkAi6dvUHU/i9Kr1HL27aN5lMvvklc1DFjdslNm3T7migAFalHe UGch0rrx2yooJ5Iz6TiKUHEyl9/lr3ojrpeXMZCQkrUFqgcd9Mbm8ykT9k2A== Received: from c8d966988b92 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 22D5A6914A0 for ; Wed, 11 Feb 2026 01:41:59 +0200 (EET) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Tue, 10 Feb 2026 23:41:38 -0000 Message-ID: <177076738160.25.3761966764312119924@009cbcb3d8cd> Message-ID-Hash: UZV3OFCQQA5VV54ABP2AO7NYHCKZWVVP X-Message-ID-Hash: UZV3OFCQQA5VV54ABP2AO7NYHCKZWVVP 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] [PR] avcodec/libvorbisdec: output AV_SAMPLE_FMT_FLTP (PR #21717) 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: michaelni via ffmpeg-devel Cc: michaelni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #21717 opened by michaelni URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21717 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/21717.patch This removes the internal sample format convert Fixes: nan is outside the range of representable values of type 'int' Fixes: 471946097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_DEC_fuzzer-4843605174059008 Signed-off-by: Michael Niedermayer >>From 90269d74b9632c0d3b6b6d7a6d8ea8137806c31a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Tue, 10 Feb 2026 16:08:41 +0100 Subject: [PATCH] avcodec/libvorbisdec: output AV_SAMPLE_FMT_FLTP This removes the internal sample format convert Fixes: nan is outside the range of representable values of type 'int' Fixes: 471946097/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_LIBVORBIS_DEC_fuzzer-4843605174059008 Signed-off-by: Michael Niedermayer --- libavcodec/libvorbisdec.c | 32 ++++++-------------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/libavcodec/libvorbisdec.c b/libavcodec/libvorbisdec.c index 326ed4b4fe..b081c42820 100644 --- a/libavcodec/libvorbisdec.c +++ b/libavcodec/libvorbisdec.c @@ -18,6 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include #include "avcodec.h" @@ -124,7 +125,7 @@ static av_cold int oggvorbis_decode_init(AVCodecContext *avccontext) avccontext->ch_layout.order = AV_CHANNEL_ORDER_UNSPEC; avccontext->ch_layout.nb_channels = context->vi.channels; avccontext->sample_rate = context->vi.rate; - avccontext->sample_fmt = AV_SAMPLE_FMT_S16; + avccontext->sample_fmt = AV_SAMPLE_FMT_FLTP; avccontext->time_base= (AVRational){1, avccontext->sample_rate}; vorbis_synthesis_init(&context->vd, &context->vi); @@ -138,33 +139,14 @@ static av_cold int oggvorbis_decode_init(AVCodecContext *avccontext) } -static inline int conv(int samples, float **pcm, char *buf, int channels) { - int i, j; - ogg_int16_t *ptr, *data = (ogg_int16_t*)buf ; - float *mono ; - - for(i = 0 ; i < channels ; i++){ - ptr = &data[i]; - mono = pcm[i] ; - - for(j = 0 ; j < samples ; j++) { - *ptr = av_clip_int16(mono[j] * 32767.f); - ptr += channels; - } - } - - return 0 ; -} - static int oggvorbis_decode_frame(AVCodecContext *avccontext, AVFrame *frame, int *got_frame_ptr, AVPacket *avpkt) { OggVorbisDecContext *context = avccontext->priv_data ; float **pcm ; ogg_packet *op= &context->op; - int samples, total_samples, total_bytes; + int samples, total_samples; int ret; - int16_t *output; if(!avpkt->size){ //FIXME flush @@ -174,8 +156,6 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, AVFrame *frame, frame->nb_samples = 8192*4; if ((ret = ff_get_buffer(avccontext, frame, 0)) < 0) return ret; - output = (int16_t *)frame->data[0]; - op->packet = avpkt->data; op->bytes = avpkt->size; @@ -190,11 +170,10 @@ static int oggvorbis_decode_frame(AVCodecContext *avccontext, AVFrame *frame, vorbis_synthesis_blockin(&context->vd, &context->vb) ; total_samples = 0 ; - total_bytes = 0 ; while((samples = vorbis_synthesis_pcmout(&context->vd, &pcm)) > 0) { - conv(samples, pcm, (char*)output + total_bytes, context->vi.channels) ; - total_bytes += samples * 2 * context->vi.channels ; + for (int ch = 0; ch < context->vi.channels; ch++) + memcpy((float *)frame->extended_data[ch] + total_samples, pcm[ch], samples * sizeof(float)); total_samples += samples ; vorbis_synthesis_read(&context->vd, samples) ; } @@ -229,4 +208,5 @@ const FFCodec ff_libvorbis_decoder = { .init = oggvorbis_decode_init, FF_CODEC_DECODE_CB(oggvorbis_decode_frame), .close = oggvorbis_decode_close, + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), }; -- 2.52.0 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org