Mercurial > libavformat.hg
changeset 6322:408722fc3bf1 libavformat
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
author | mstorsjo |
---|---|
date | Tue, 27 Jul 2010 08:16:03 +0000 |
parents | 6d379528ffce |
children | 4a52e54b7c12 |
files | rtpdec_xiph.c |
diffstat | 1 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/rtpdec_xiph.c Tue Jul 27 08:03:09 2010 +0000 +++ b/rtpdec_xiph.c Tue Jul 27 08:16:03 2010 +0000 @@ -172,6 +172,11 @@ 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);