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 6921047104 for ; Thu, 27 Jul 2023 17:33:20 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8AAA768CA5F; Thu, 27 Jul 2023 20:33:17 +0300 (EEST) Received: from nef.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E5CCD68C968 for ; Thu, 27 Jul 2023 20:33:10 +0300 (EEST) X-ENS-nef-client: 129.199.129.80 ( name = phare.normalesup.org ) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef.ens.fr (8.14.4/1.01.28121999) with ESMTP id 36RHX9dA023814 ; Thu, 27 Jul 2023 19:33:09 +0200 Received: by phare.normalesup.org (Postfix, from userid 1001) id 59F1DEB5B7; Thu, 27 Jul 2023 19:33:09 +0200 (CEST) Date: Thu, 27 Jul 2023 19:33:09 +0200 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: References: <12826EED-5CFC-4DC4-ACEE-0BB505704FE7@reimardoeffinger.de> <20230723120016.92184-1-Reimar.Doeffinger@gmx.de> MIME-Version: 1.0 In-Reply-To: <20230723120016.92184-1-Reimar.Doeffinger@gmx.de> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef.ens.fr [129.199.96.32]); Thu, 27 Jul 2023 19:33:09 +0200 (CEST) Subject: Re: [FFmpeg-devel] [PATCH] libaformat: fix incorrect handling of incomplete AVBPrint. 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 Cc: Reimar =?iso-8859-1?Q?D=F6ffinger?= Content-Type: multipart/mixed; boundary="===============4846161611064992305==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============4846161611064992305== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="eCJA0aTsajm2sG7d" Content-Disposition: inline --eCJA0aTsajm2sG7d Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Reimar.Doeffinger@gmx.de (12023-07-23): > From: Reimar D=C3=B6ffinger >=20 > Change some internal APIs a bit to make it harder to make > such mistakes. > In particular, have the read chunk functions return an error > when the result is incomplete. > This might be less flexible, but since there has been no > use-case for that so far, avoiding coding mistakes seems better. > Add a function to queue a AVBPrint directly (ff_subtitles_queue_insert_bp= rint). > Also fixes a leak in lrcdec when ff_subtitles_queue_insert fails. > --- > libavformat/assdec.c | 4 +++- > libavformat/lrcdec.c | 7 ++++++- > libavformat/mpsubdec.c | 5 +++-- > libavformat/realtextdec.c | 6 +++++- > libavformat/samidec.c | 6 +++++- > libavformat/srtdec.c | 4 +++- > libavformat/subtitles.c | 17 +++++++++++++---- > libavformat/subtitles.h | 14 ++++++++++++-- > libavformat/tedcaptionsdec.c | 2 +- > libavformat/webvttdec.c | 4 +++- > 10 files changed, 54 insertions(+), 15 deletions(-) Sorry I forgot I meant to review. These changes look for the best, except=20 > + if (!av_bprint_is_complete(event)) return NULL; > + if (i =3D=3D INT_MAX) return AVERROR_INVALIDDATA; =E2=80=A6 which do not follow the coding style. (The dynamic buffer writer of the AVWriter API makes it much harder to forget checking. But AVWriter is currently in limbo waiting for this project to reaffirm its orientation.) Regards, --=20 Nicolas George --eCJA0aTsajm2sG7d Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE6ooRQGBoNzw0KnwPcZVLI8pNxgwFAmTCqlMACgkQcZVLI8pN xgwaExAAmrd7LFQT4SXvTdkJ5ocKqnq+2Eas0Fxd/9RBsbKxRbX+PXLk8V1MfjUJ /Qo/G3j5mQMpTzLr3N8hyS80MPF9eOe1PrqpFZ2rujKrolbNg+ZrmKXRC4f5ccIs r/j0S/IICDufs9SZJ8Tnh1hgiIXPQjuqF8cQlFms02zI6EkSzKg9sCumcRKVk8pf 8h5ry3+VBga0Ei1x8iev+1R+vOWIdg7CbKXpuSE11Rog/l6cRuLCSyxo1fgLqL2X 0QhQJhrxzWx4YZ2z3wx08QKEZ/kbqT4WRZI4e+Y4c6yOKXZwqImUhKGmQ8zm/gkj TrNZ1ladD5TJ5JDX1G5tz8DGx2PQUxyLB/0yAtq+a0crTdYe5AeHZH2a79T1kkf3 5wzvg4ExT39vt+V4+Brf6WaEuqOmb9rRVQrC0b37dhTLExqEKPjOCQJpjGt8eemW N+AIMPUh3PqdQDRrRgSuBdYBeH4OVM5t2O8ryY1XJkYk6iHDvivNKxRr6yQvc5fX 83mqbZ7RbKjpYaOI3vO+GQ5PukV/7TgTxKgG9sh9k5fDcOImgl73o+p9UA0I7dYn kqXqryGJ3MasO8KsdMJBMHTwGu4iVnaamWFf3p0kik8KAt5RHDxovnPPjScfWRG/ YUoD53UAOnnsitPwTfpPSk4+4eUZUX8LdtMUl+2XmoXMDlRoE4E= =KETu -----END PGP SIGNATURE----- --eCJA0aTsajm2sG7d-- --===============4846161611064992305== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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". --===============4846161611064992305==--