]> git.sesse.net Git - ffmpeg/blobdiff - libavformat/rtpenc_h264.c
Merge commit '3ffcccb4fbaae4d5ad775506f1f2761f2029affa'
[ffmpeg] / libavformat / rtpenc_h264.c
index 68f497590b014922d0e1211af66716b01e47f70d..b6c16e17d8aa5b42396060a0b8749e117804f890 100644 (file)
 
 static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t *end, int nal_length_size)
 {
-    int res = 0;
+    unsigned int res = 0;
 
     if (end - start < nal_length_size)
         return NULL;
     while (nal_length_size--)
         res = (res << 8) | *start++;
 
-    if (start + res > end || res < 0 || start + res < start)
+    if (res > end - start)
         return NULL;
 
     return start + res;