1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/vc1: simplify find_next_marker()

Signed-off-by: Zeng Zhaoxiu <zhaoxiu.zeng@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
zhaoxiu.zeng 2015-02-13 00:02:04 +08:00 committed by Michael Niedermayer
parent 3e2714992b
commit b39ac9d210

View File

@ -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)
{
if (end - src >= 4) {
uint32_t mrk = 0xFFFFFFFF;
if (end-src < 4)
return end;
while (src < end) {
mrk = (mrk << 8) | *src++;
src = avpriv_find_start_code(src, end, &mrk);
if (IS_MARKER(mrk))
return src - 4;
}