[FFmpeg-devel] [PATCH] libaformat: fix incorrect handling of incomplete AVBPrint.
James Almer
jamrial at gmail.com
Fri Jun 23 04:01:49 EEST 2023
On 6/22/2023 6:04 PM, Reimar.Doeffinger at gmx.de wrote:
> diff --git a/libavformat/realtextdec.c b/libavformat/realtextdec.c
> index c281dec346..9f6aab789e 100644
> --- a/libavformat/realtextdec.c
> +++ b/libavformat/realtextdec.c
> @@ -80,6 +80,11 @@ static int realtext_read_header(AVFormatContext *s)
> const int64_t pos = ff_text_pos(&tr) - (c != 0);
> int n = ff_smil_extract_next_text_chunk(&tr, &buf, &c);
>
> + if (n < 0)
> + {
Put the opening bracket in the same line as the if(), please.
> + res = n;
> + goto end;
> + }
> if (n == 0)
> break;
>
> @@ -103,7 +108,7 @@ static int realtext_read_header(AVFormatContext *s)
> /* if we just read a <time> tag, introduce a new event, otherwise merge
> * with the previous one */
> int merge = !av_strncasecmp(buf.str, "<time", 5) ? 0 : 1;
> - sub = ff_subtitles_queue_insert(&rt->q, buf.str, buf.len, merge);
> + sub = ff_subtitles_queue_insert_bprint(&rt->q, &buf, merge);
> if (!sub) {
> res = AVERROR(ENOMEM);
> goto end;
> diff --git a/libavformat/samidec.c b/libavformat/samidec.c
> index 0da299343d..6fff6019bf 100644
> --- a/libavformat/samidec.c
> +++ b/libavformat/samidec.c
> @@ -68,6 +68,11 @@ static int sami_read_header(AVFormatContext *s)
> const int64_t pos = ff_text_pos(&tr) - (c != 0);
> int is_sync, is_body, n = ff_smil_extract_next_text_chunk(&tr, &buf, &c);
>
> + if (n < 0)
> + {
Ditto.
> + res = n;
> + goto end;
> + }
> if (n == 0)
> break;
More information about the ffmpeg-devel
mailing list