Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
parser hevc: fix for FunBox 4K, fixes #3853
  • Loading branch information
perexg committed Nov 2, 2016
1 parent 18b3457 commit 95e20e2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/parsers/parser_hevc.c
Expand Up @@ -1677,6 +1677,7 @@ hevc_decode_slice_header(struct elementary_stream *st, bitstream_t *bs,
u = ilog2((v - 1) << 1);
if (u >= v)
return -1;
skip_bits(bs, u);
}

if (dependent_slice_segment)
Expand Down
7 changes: 5 additions & 2 deletions src/parsers/parsers.c
Expand Up @@ -1596,8 +1596,11 @@ parse_hevc(service_t *t, elementary_stream_t *st, size_t len,
case HEVC_NAL_IDR_W_RADL:
case HEVC_NAL_IDR_N_LP:
case HEVC_NAL_CRA_NUT:
if (st->es_curpkt != NULL)
break;

l2 = len - 3 > 64 ? 64 : len - 3;
void *f = h264_nal_deescape(&bs, buf + 3, len - 3);
void *f = h264_nal_deescape(&bs, buf + 3, l2);
r = hevc_decode_slice_header(st, &bs, &pkttype);
free(f);
if (r < 0)
Expand Down Expand Up @@ -1658,7 +1661,7 @@ parse_hevc(service_t *t, elementary_stream_t *st, size_t len,
}

if(is_ssc(next_startcode) ||
((next_startcode >> 1) & 0x3f) == HEVC_NAL_TRAIL_R) {
((next_startcode >> 1) & 0x3f) == HEVC_NAL_AUD) {
/* Complete frame - new start code or delimiter */
if (st->es_incomplete)
return PARSER_HEADER;
Expand Down

0 comments on commit 95e20e2

Please sign in to comment.