mirror of https://git.ffmpeg.org/ffmpeg.git
avfilter/f_reverse: Apply PTS compensation only when pts is available
Fixes: out of array access
Fixes: tickets/10753/poc16ffmpeg
Regression since: 45dc668aea
Found-by: Zeng Yunxiang
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
50f0f8c53c
commit
61e73851a3
|
@ -266,7 +266,8 @@ static int areverse_request_frame(AVFilterLink *outlink)
|
||||||
AVFrame *out = s->frames[s->nb_frames - 1];
|
AVFrame *out = s->frames[s->nb_frames - 1];
|
||||||
out->duration = s->duration[s->flush_idx];
|
out->duration = s->duration[s->flush_idx];
|
||||||
out->pts = s->pts[s->flush_idx++] - s->nb_samples;
|
out->pts = s->pts[s->flush_idx++] - s->nb_samples;
|
||||||
s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples;
|
if (s->nb_frames > 1)
|
||||||
|
s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples;
|
||||||
|
|
||||||
if (av_sample_fmt_is_planar(out->format))
|
if (av_sample_fmt_is_planar(out->format))
|
||||||
reverse_samples_planar(out);
|
reverse_samples_planar(out);
|
||||||
|
|
Loading…
Reference in New Issue