avcodec/h264/find_start_code: factorize addition out
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Apr 2014 02:18:21 +0000 (04:18 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 7 Apr 2014 02:18:21 +0000 (04:18 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavcodec/h264.c

index a679baf..dd70af3 100644 (file)
@@ -1326,10 +1326,12 @@ static int find_start_code(const uint8_t *buf, int buf_size,
             buf[buf_index + 2] == 1)
             break;
 
-    if (buf_index + 3 >= buf_size)
+    buf_index += 3;
+
+    if (buf_index >= buf_size)
         return buf_size;
 
-    return buf_index + 3;
+    return buf_index;
 }
 
 static int get_avc_nalsize(H264Context *h, const uint8_t *buf,