]> git.kaiwu.me - nginx.git/commitdiff
Fixed handling of mp4 above 2G and 32bit offsets (ticket #84).
authorMaxim Dounin <mdounin@mdounin.ru>
Mon, 16 Jan 2012 11:03:27 +0000 (11:03 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Mon, 16 Jan 2012 11:03:27 +0000 (11:03 +0000)
src/http/modules/ngx_http_mp4_module.c

index 7bfb3db666f506763ef76f480194b57b0f169955..6de7c8fea75bcf6bf62d59fbfa44d5f317763b7d 100644 (file)
@@ -165,10 +165,10 @@ typedef struct {
     ((u_char *) (p))[7] = n4
 
 #define ngx_mp4_get_32value(p)                                                \
-    ( (((u_char *) (p))[0] << 24)                                             \
-    + (((u_char *) (p))[1] << 16)                                             \
-    + (((u_char *) (p))[2] << 8)                                              \
-    + (((u_char *) (p))[3]) )
+    ( ((uint32_t) ((u_char *) (p))[0] << 24)                                  \
+    + (           ((u_char *) (p))[1] << 16)                                  \
+    + (           ((u_char *) (p))[2] << 8)                                   \
+    + (           ((u_char *) (p))[3]) )
 
 #define ngx_mp4_set_32value(p, n)                                             \
     ((u_char *) (p))[0] = (u_char) ((n) >> 24);                               \