h2645_parse: don't overread AnnexB NALs within an avc stream

We know the maximum size of an AnnexB NAL, signaling it as the maximum
NAL size allows ff_h2645_extract_rbsp to determine the correct size.

(cherry picked from commit 83a940e7fb9640954d631870e2ec6e8b3fc528ed)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Hendrik Leppkes 2016-07-07 20:19:51 +02:00 committed by Michael Niedermayer
parent 93422bc92e
commit 0ad4d4198a

View File

@ -291,7 +291,7 @@ int ff_h2645_packet_split(H2645Packet *pkt, const uint8_t *buf, int length,
buf += 3;
length -= 3;
extract_length = length;
extract_length = FFMIN(length, next_avc - buf);
if (buf >= next_avc) {
/* skip to the start of the next NAL */