diff options
author | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-03-27 00:54:11 +0000 |
---|---|---|
committer | morriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7> | 2010-03-27 00:54:11 +0000 |
commit | 05e6c16cad4f036c2e443ecde06c2129ed14de0b (patch) | |
tree | fddd4607f5f3ae32b9e56d9db9a4e7e2d281f5ed /gtk | |
parent | 25557145a618b31cd37246217de23a98eb322187 (diff) |
Fix (or at least work around the crash in)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4119 :
Never insert more than 1000 silence frames (e.g., if the sequence number jumps
massively). There may be a better way, but at least now we won't crash.
Leave a comment in the code indicating this.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32304 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/rtp_player.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/gtk/rtp_player.c b/gtk/rtp_player.c index d56b62a29c..adcb283dfd 100644 --- a/gtk/rtp_player.c +++ b/gtk/rtp_player.c @@ -778,8 +778,14 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_) #ifdef DEBUG printf("Resync...\n"); #endif - silence_frames = (gint32)((arrive_time - arrive_time_prev)*SAMPLE_RATE - decoded_bytes_prev/2); + + /* Fix for bug 4119: don't insert more than 1000 silence frames. + * XXX - is there a better thing to do here? + */ + if (silence_frames > 1000) + silence_frames = 1000; + for (i = 0; i< silence_frames; i++) { silence.status = status; g_array_append_val(rci->samples, silence); @@ -801,6 +807,13 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_) rci->wrong_timestamp++; status = S_WRONG_TIMESTAMP; } + + /* Fix for bug 4119: don't insert more than 1000 silence frames. + * XXX - is there a better thing to do here? + */ + if (silence_frames > 1000) + silence_frames = 1000; + for (i = 0; i< silence_frames; i++) { silence.status = status; g_array_append_val(rci->samples, silence); @@ -825,7 +838,6 @@ decode_rtp_stream(rtp_stream_info_t *rsi, gpointer ptr _U_) pack_period = (double)(decoded_bytes/2)/SAMPLE_RATE; decoded_bytes_prev = decoded_bytes; arrive_time_prev = arrive_time; - } if (out_buff) { |