aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Abeni <lucabe72@email.it>2008-07-10 07:40:54 +0000
committerLuca Abeni <lucabe72@email.it>2008-07-10 07:40:54 +0000
commit80150f7ee813849c47f2612378dd2cab3c1d4c98 (patch)
tree0b71c4c48349429de49693e0548484f26cd0535c
parentbb68f8a2b6d2352c0cf5fd3b6f99ac2391abaa25 (diff)
downloadffmpeg-80150f7ee813849c47f2612378dd2cab3c1d4c98.tar.gz
Fix MPEG video packetization for RTP
Originally committed as revision 14149 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/rtp_mpv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/rtp_mpv.c b/libavformat/rtp_mpv.c
index 061eb35192..2c67f058a0 100644
--- a/libavformat/rtp_mpv.c
+++ b/libavformat/rtp_mpv.c
@@ -66,7 +66,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
begin_of_sequence = 1;
}
- if (r - buf1 < len) {
+ if (r - buf1 - 4 <= len) {
/* The current slice fits in the packet */
if (begin_of_slice == 0) {
/* no slice at the beginning of the packet... */
@@ -76,7 +76,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
}
r1 = r;
} else {
- if (r - r1 < max_packet_size - 4) {
+ if ((r1 - buf1 > 4) && (r - r1 < max_packet_size)) {
len = r1 - buf1 - 4;
end_of_slice = 1;
}