diff options
author | zhaoxiu.zeng <zhaoxiu.zeng@gmail.com> | 2015-02-13 00:02:04 +0800 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-02-13 14:01:45 +0100 |
commit | b39ac9d210df05c92e57df04ace61f90d6f3b5bd (patch) | |
tree | c5665cd3a13d7d24e14fd61172cca308f0c05959 | |
parent | 3e2714992b5023260ebfafd5d8f7d4cd0e2bdd80 (diff) | |
download | ffmpeg-b39ac9d210df05c92e57df04ace61f90d6f3b5bd.tar.gz |
avcodec/vc1: simplify find_next_marker()
Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/vc1_common.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/libavcodec/vc1_common.h b/libavcodec/vc1_common.h index cd67b17d47..b46c33f7e2 100644 --- a/libavcodec/vc1_common.h +++ b/libavcodec/vc1_common.h @@ -26,6 +26,7 @@ #include <stdint.h> #include "libavutil/attributes.h" +#include "internal.h" /** Markers used in VC-1 AP frame data */ //@{ @@ -57,12 +58,9 @@ enum Profile { */ static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end) { - uint32_t mrk = 0xFFFFFFFF; - - if (end-src < 4) - return end; - while (src < end) { - mrk = (mrk << 8) | *src++; + if (end - src >= 4) { + uint32_t mrk = 0xFFFFFFFF; + src = avpriv_find_start_code(src, end, &mrk); if (IS_MARKER(mrk)) return src - 4; } |