diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-07-04 03:48:36 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-07-04 04:17:00 +0200 |
commit | df3a96c497c0db51c917e51e5e4a60986979db91 (patch) | |
tree | b9fd2f8a0ef95a9c76eb2b332045981a3e691c4a | |
parent | a54bc1ebb8b0fe31b6088c19ff0c8e53b94a70ad (diff) | |
download | ffmpeg-df3a96c497c0db51c917e51e5e4a60986979db91.tar.gz |
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@gmx.at>
-rw-r--r-- | ffmpeg.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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); } |