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 211AF4A8AE for ; Sat, 18 May 2024 16:19:55 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id A26A168CE03; Sat, 18 May 2024 19:19:52 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2F89368CABD for ; Sat, 18 May 2024 19:19:46 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 0D61FEA67D for ; Sat, 18 May 2024 18:19:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XKJtgwKA_Q3Q for ; Sat, 18 May 2024 18:19:43 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 466A3EA67C for ; Sat, 18 May 2024 18:19:43 +0200 (CEST) Date: Sat, 18 May 2024 18:19:43 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <20240514200226.4320-1-cus@passwd.hu> Message-ID: References: <20240514200226.4320-1-cus@passwd.hu> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/3] avformat/mp3dec: only call ffio_ensure_seekback once 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Tue, 14 May 2024, Marton Balint wrote: > Otherwise the subsequent ffio_ensure_seekback calls destroy the buffer of the > earlier. The worst case ~66kB seekback is so small it is easier to request it > entirely. > > Fixes ticket #10837, a regression since > 0d17f5228f4d3854066ec1001f69c7d1714b0df9. Will apply the series in 1-2 days. Regards, Marton > > Signed-off-by: Marton Balint > --- > libavformat/mp3dec.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) > > diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c > index ec6cf567bc..78d6c8c71c 100644 > --- a/libavformat/mp3dec.c > +++ b/libavformat/mp3dec.c > @@ -32,6 +32,7 @@ > #include "replaygain.h" > > #include "libavcodec/codec_id.h" > +#include "libavcodec/mpegaudio.h" > #include "libavcodec/mpegaudiodecheader.h" > > #define XING_FLAG_FRAMES 0x01 > @@ -400,15 +401,16 @@ static int mp3_read_header(AVFormatContext *s) > if (ret < 0) > return ret; > > + ret = ffio_ensure_seekback(s->pb, 64 * 1024 + MPA_MAX_CODED_FRAME_SIZE + 4); > + if (ret < 0) > + return ret; > + > off = avio_tell(s->pb); > for (i = 0; i < 64 * 1024; i++) { > uint32_t header, header2; > int frame_size; > - if (!(i&1023)) > - ffio_ensure_seekback(s->pb, i + 1024 + 4); > frame_size = check(s->pb, off + i, &header); > if (frame_size > 0) { > - ffio_ensure_seekback(s->pb, i + 1024 + frame_size + 4); > ret = check(s->pb, off + i + frame_size, &header2); > if (ret >= 0 && > (header & MP3_MASK) == (header2 & MP3_MASK)) > -- > 2.35.3 > > _______________________________________________ > 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". > _______________________________________________ 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".