[FFmpeg-cvslog] avcodec/h264/find_start_code: factorize addition out

Michael Niedermayer git at videolan.org
Mon Apr 7 04:57:36 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Apr  7 04:18:21 2014 +0200| [a75ba1e116a4559ef842218c22288c8c2011f748] | committer: Michael Niedermayer

avcodec/h264/find_start_code: factorize addition out

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/h264.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index a679baf..dd70af3 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -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,



More information about the ffmpeg-cvslog mailing list