From: Nicolas George <george@nsup.org> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: "Reimar Döffinger" <Reimar.Doeffinger@gmx.de> Subject: Re: [FFmpeg-devel] [PATCH] libaformat: fix incorrect handling of incomplete AVBPrint. Date: Thu, 27 Jul 2023 19:33:09 +0200 Message-ID: <ZMKqVcJyPsoHq4JD@phare.normalesup.org> (raw) In-Reply-To: <20230723120016.92184-1-Reimar.Doeffinger@gmx.de> [-- Attachment #1.1: Type: text/plain, Size: 1540 bytes --] Reimar.Doeffinger@gmx.de (12023-07-23): > From: Reimar Döffinger <Reimar.Doeffinger@gmx.de> > > 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_bprint). > 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 > + if (!av_bprint_is_complete(event)) return NULL; > + if (i == INT_MAX) return AVERROR_INVALIDDATA; … 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, -- Nicolas George [-- Attachment #1.2: signature.asc --] [-- Type: application/pgp-signature, Size: 833 bytes --] [-- Attachment #2: Type: text/plain, Size: 251 bytes --] _______________________________________________ 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".
next prev parent reply other threads:[~2023-07-27 17:33 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <12826EED-5CFC-4DC4-ACEE-0BB505704FE7@reimardoeffinger.de> 2023-07-23 12:00 ` Reimar.Doeffinger 2023-07-27 17:26 ` Reimar Döffinger 2023-07-27 17:33 ` Nicolas George [this message] 2023-07-27 17:40 ` [FFmpeg-devel] [PATCH] libavformat: " Reimar.Doeffinger 2023-07-27 17:42 ` [FFmpeg-devel] [PATCH] libaformat: " Reimar Döffinger 2023-07-27 17:44 ` Nicolas George 2023-07-29 14:31 ` Reimar Döffinger 2023-06-22 21:04 Reimar.Doeffinger 2023-06-23 1:01 ` James Almer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ZMKqVcJyPsoHq4JD@phare.normalesup.org \ --to=george@nsup.org \ --cc=Reimar.Doeffinger@gmx.de \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git