Commit b39ac9d2 authored by zhaoxiu.zeng's avatar zhaoxiu.zeng Committed by Michael Niedermayer

avcodec/vc1: simplify find_next_marker()

Signed-off-by: 's avatarZeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 3e271499
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <stdint.h> #include <stdint.h>
#include "libavutil/attributes.h" #include "libavutil/attributes.h"
#include "internal.h"
/** Markers used in VC-1 AP frame data */ /** Markers used in VC-1 AP frame data */
//@{ //@{
...@@ -57,12 +58,9 @@ enum Profile { ...@@ -57,12 +58,9 @@ enum Profile {
*/ */
static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end) static av_always_inline const uint8_t* find_next_marker(const uint8_t *src, const uint8_t *end)
{ {
if (end - src >= 4) {
uint32_t mrk = 0xFFFFFFFF; uint32_t mrk = 0xFFFFFFFF;
src = avpriv_find_start_code(src, end, &mrk);
if (end-src < 4)
return end;
while (src < end) {
mrk = (mrk << 8) | *src++;
if (IS_MARKER(mrk)) if (IS_MARKER(mrk))
return src - 4; return src - 4;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment