From 7f2228dbfec0268b8b486573041043c0de1aa381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reimar=20D=C3=B6ffinger?= Date: Wed, 15 Jun 2011 20:21:33 +0200 Subject: [PATCH] Make buffer size check consistent and avoid a possible overflow. --- libavformat/rtpenc_h264.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/rtpenc_h264.c b/libavformat/rtpenc_h264.c index 0f8850ee77..11074d0d51 100644 --- a/libavformat/rtpenc_h264.c +++ b/libavformat/rtpenc_h264.c @@ -40,7 +40,7 @@ static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t res = (res << 8) | *start++; } - if (res + start > end) { + if (end - start < res) { return NULL; }