[FFmpeg-cvslog] ffmpeg: Add sanity check on frame duplication
Michael Niedermayer
git at videolan.org
Wed Jul 4 04:17:26 CEST 2012
ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Jul 4 03:48:36 2012 +0200| [df3a96c497c0db51c917e51e5e4a60986979db91] | committer: Michael Niedermayer
ffmpeg: Add sanity check on frame duplication
This prevents long loops and OOM in case of damaged timestamps in some
cases
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=df3a96c497c0db51c917e51e5e4a60986979db91
---
ffmpeg.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/ffmpeg.c b/ffmpeg.c
index 25112d3..a19f207 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1770,6 +1770,11 @@ static void do_video_out(AVFormatContext *s,
av_log(NULL, AV_LOG_VERBOSE, "*** drop!\n");
return;
} else if (nb_frames > 1) {
+ if (nb_frames > dts_error_threshold * 30) {
+ av_log(NULL, AV_LOG_ERROR, "%d frame duplication too large, skiping\n", nb_frames - 1);
+ nb_frames_drop++;
+ return;
+ }
nb_frames_dup += nb_frames - 1;
av_log(NULL, AV_LOG_VERBOSE, "*** %d dup!\n", nb_frames - 1);
}
More information about the ffmpeg-cvslog
mailing list