diff options
author | Josh Allmann <joshua.allmann@gmail.com> | 2010-07-27 08:16:03 +0000 |
---|---|---|
committer | Martin Storsjö <martin@martin.st> | 2010-07-27 08:16:03 +0000 |
commit | adc03a34069efe13857d580e3d973121b7b8a8d3 (patch) | |
tree | dee115f3b2a13f76cc72f74418e52c08eeae1ec4 /libavformat/rtpdec_xiph.c | |
parent | 4db40efa4709fb58498ef32673acf55504a33ce3 (diff) | |
download | ffmpeg-adc03a34069efe13857d580e3d973121b7b8a8d3.tar.gz |
rtpdec_xiph: Drop RTP packets that come in without a prior fragment start marker.
This can avoid segfaults in some cases.
Patch by Josh Allmann, joshua dot allmann at gmail
Originally committed as revision 24537 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/rtpdec_xiph.c')
-rw-r--r-- | libavformat/rtpdec_xiph.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rtpdec_xiph.c b/libavformat/rtpdec_xiph.c index 4c9cad2877..bcf583fd0a 100644 --- a/libavformat/rtpdec_xiph.c +++ b/libavformat/rtpdec_xiph.c @@ -172,6 +172,11 @@ static int xiph_handle_packet(AVFormatContext * ctx, av_log(ctx, AV_LOG_ERROR, "RTP timestamps don't match!\n"); return AVERROR_INVALIDDATA; } + if (!data->fragment) { + av_log(ctx, AV_LOG_WARNING, + "Received packet without a start fragment; dropping.\n"); + return AVERROR(EAGAIN); + } // copy data to fragment buffer put_buffer(data->fragment, buf, pkt_len); |