[FFmpeg-cvslog] Make buffer size check consistent and avoid a possible overflow.

Reimar Döffinger git at videolan.org
Wed Jun 15 20:22:40 CEST 2011


ffmpeg | branch: master | Reimar Döffinger <Reimar.Doeffinger at gmx.de> | Wed Jun 15 20:21:33 2011 +0200| [7f2228dbfec0268b8b486573041043c0de1aa381] | committer: Reimar Döffinger

Make buffer size check consistent and avoid a possible overflow.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7f2228dbfec0268b8b486573041043c0de1aa381
---

 libavformat/rtpenc_h264.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/rtpenc_h264.c b/libavformat/rtpenc_h264.c
index 0f8850e..11074d0 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;
     }
 



More information about the ffmpeg-cvslog mailing list