diff options
Diffstat (limited to 'libavcodec/vc1_common.h')
-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; } |