mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
libavformat: fix incorrect handling of incomplete AVBPrint.
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. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
This commit is contained in:
@@ -244,7 +244,7 @@ static int parse_file(AVIOContext *pb, FFDemuxSubtitlesQueue *subs)
|
||||
ret = AVERROR_INVALIDDATA;
|
||||
goto fail;
|
||||
}
|
||||
pkt = ff_subtitles_queue_insert(subs, content.str, content.len, 0);
|
||||
pkt = ff_subtitles_queue_insert_bprint(subs, &content, 0);
|
||||
if (!pkt) {
|
||||
ret = AVERROR(ENOMEM);
|
||||
goto fail;
|
||||
|
||||
Reference in New Issue
Block a user