Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-07-04 05:48:36 +0400
committerMichael Niedermayer <michaelni@gmx.at>2012-07-04 06:17:00 +0400
commitdf3a96c497c0db51c917e51e5e4a60986979db91 (patch)
treeb9fd2f8a0ef95a9c76eb2b332045981a3e691c4a /ffmpeg.c
parenta54bc1ebb8b0fe31b6088c19ff0c8e53b94a70ad (diff)
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>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 25112d3e2c..a19f2077ba 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);
}