Fixes: out of array access Fixes: tickets/10753/poc16ffmpeg Regression since: 45dc668aea0edac34969b5a1ff76cf9ad3a09be1 Found-by: Zeng Yunxiang Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -266,7 +266,8 @@ static int areverse_request_frame(AVFilterLink *outlink) · 265 unmodified lines | |||
| 266 | AVFrame *out = s->frames[s->nb_frames - 1]; | 266 | AVFrame *out = s->frames[s->nb_frames - 1]; |
| 267 | out->duration = s->duration[s->flush_idx]; | 267 | out->duration = s->duration[s->flush_idx]; |
| 268 | out->pts = s->pts[s->flush_idx++] - s->nb_samples; | 268 | out->pts = s->pts[s->flush_idx++] - s->nb_samples; |
| 269 | s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples; | 269 | if (s->nb_frames > 1) |
| 270 | s->nb_samples += s->pts[s->flush_idx] - s->pts[s->flush_idx - 1] - out->nb_samples; | ||
| 270 | 271 | ||
| 271 | if (av_sample_fmt_is_planar(out->format)) | 272 | if (av_sample_fmt_is_planar(out->format)) |
| 272 | reverse_samples_planar(out); | 273 | reverse_samples_planar(out); |