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 39713471C5 for ; Thu, 28 Sep 2023 09:38:07 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E46E768CAE7; Thu, 28 Sep 2023 12:38:03 +0300 (EEST) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 8A71468CA99 for ; Thu, 28 Sep 2023 12:37:57 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id EFE32240490 for ; Thu, 28 Sep 2023 11:37:56 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id Vd_wdZOS42vT for ; Thu, 28 Sep 2023 11:37:56 +0200 (CEST) Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 82668240445 for ; Thu, 28 Sep 2023 11:37:53 +0200 (CEST) Received: by lain.khirnov.net (Postfix, from userid 1000) id 6B85F1601B9; Thu, 28 Sep 2023 11:37:53 +0200 (CEST) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: References: Mail-Followup-To: FFmpeg development discussions and patches Date: Thu, 28 Sep 2023 11:37:53 +0200 Message-ID: <169589387341.6638.15012517934493438253@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avcodec/photocd: allow decoding vlc with errors 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: Quoting Paul B Mahol (2023-09-27 21:53:54) > Attached. > > From 6b7e51e2b4facead9c45fb94647c85b58e6fdf22 Mon Sep 17 00:00:00 2001 > From: Paul B Mahol > Date: Wed, 27 Sep 2023 21:48:49 +0200 > Subject: [PATCH] avcodec/photocd: allow decoding vlc with errors > > Also rename option that no longer works. > Also make tables finding more robust. Why do all these things in a single patch? And why are there no tests for this decoder? > Signed-off-by: Paul B Mahol > --- > libavcodec/photocd.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/libavcodec/photocd.c b/libavcodec/photocd.c > index 07e8d460bd..a9e42bb86a 100644 > --- a/libavcodec/photocd.c > +++ b/libavcodec/photocd.c > @@ -277,8 +277,6 @@ static av_noinline int decode_huff(AVCodecContext *avctx, AVFrame *frame, > if (get_bits_left(&g) <= 0) > return AVERROR_INVALIDDATA; > m = get_vlc2(&g, s->vlc[idx].table, s->vlc[idx].bits, 2); > - if (m < 0) > - return AVERROR_INVALIDDATA; Shouldn't this error be at least logged? Perhaps it should still fail on AV_EF_EXPLODE. > m = sign_extend(m, 8); > data[x] = av_clip_uint8(data[x] + m); > } > @@ -389,6 +387,7 @@ static int photocd_decode_frame(AVCodecContext *avctx, AVFrame *p, > return AVERROR_INVALIDDATA; > > if (s->resolution == 4) { > + s->streampos = (AV_RB16(avpkt->data + 2048 + 1536 + 3) + 12) * 2048; Where do these magic numbers come from? Same below. -- Anton Khirnov _______________________________________________ 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".