mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2024-12-22 23:33:07 +00:00
h2645_parse: allow partial escaping
This ports the fix from 033a533
to the new parser module in prepartion
of using it for the h264 decoder.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
This commit is contained in:
parent
c802389393
commit
9cc1ab63ac
@ -38,7 +38,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
|||||||
nal->skipped_bytes = 0;
|
nal->skipped_bytes = 0;
|
||||||
#define STARTCODE_TEST \
|
#define STARTCODE_TEST \
|
||||||
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
|
if (i + 2 < length && src[i + 1] == 0 && src[i + 2] <= 3) { \
|
||||||
if (src[i + 2] != 3) { \
|
if (src[i + 2] != 3 && src[i + 2] != 0) { \
|
||||||
/* startcode, so we must be past the end */ \
|
/* startcode, so we must be past the end */ \
|
||||||
length = i; \
|
length = i; \
|
||||||
} \
|
} \
|
||||||
@ -103,7 +103,7 @@ int ff_h2645_extract_rbsp(const uint8_t *src, int length,
|
|||||||
if (src[si + 2] > 3) {
|
if (src[si + 2] > 3) {
|
||||||
dst[di++] = src[si++];
|
dst[di++] = src[si++];
|
||||||
dst[di++] = src[si++];
|
dst[di++] = src[si++];
|
||||||
} else if (src[si] == 0 && src[si + 1] == 0) {
|
} else if (src[si] == 0 && src[si + 1] == 0 && src[si + 2] != 0) {
|
||||||
if (src[si + 2] == 3) { // escape
|
if (src[si + 2] == 3) { // escape
|
||||||
dst[di++] = 0;
|
dst[di++] = 0;
|
||||||
dst[di++] = 0;
|
dst[di++] = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user