X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fsubviewer1dec.c;h=f2eee294a1cb7cad85d8e52bdfe699268c7d98eb;hb=704017d91ec8fbade0de072d222018c1a6013b70;hp=e579d1ca9aee88495df205fabc4cd969a676b07a;hpb=8822e2b9543bb02fb2889dff627b6db023053253;p=ffmpeg diff --git a/libavformat/subviewer1dec.c b/libavformat/subviewer1dec.c index e579d1ca9ae..f2eee294a1c 100644 --- a/libavformat/subviewer1dec.c +++ b/libavformat/subviewer1dec.c @@ -31,7 +31,7 @@ typedef struct { FFDemuxSubtitlesQueue q; } SubViewer1Context; -static int subviewer1_probe(AVProbeData *p) +static int subviewer1_probe(const AVProbeData *p) { const unsigned char *ptr = p->buf; @@ -77,8 +77,10 @@ static int subviewer1_read_header(AVFormatContext *s) sub->duration = pts_start - sub->pts; } else { sub = ff_subtitles_queue_insert(&subviewer1->q, line, len, 0); - if (!sub) + if (!sub) { + ff_subtitles_queue_clean(&subviewer1->q); return AVERROR(ENOMEM); + } sub->pos = pos; sub->pts = pts_start; sub->duration = -1;