aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHendrik Leppkes <h.leppkes@gmail.com>2016-07-07 20:19:51 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2016-08-25 03:29:36 +0200
commit0ad4d4198a40f3907b77390d525bf6fd7868538f (patch)
tree7f6cba8c0544a8c2a2e99d2035dacfc44d15802e
parent93422bc92e942e71b2435e7dac7dbbad3a32ddcc (diff)
downloadffmpeg-0ad4d4198a40f3907b77390d525bf6fd7868538f.tar.gz
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>
-rw-r--r--libavcodec/h2645_parse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/h2645_parse.c b/libavcodec/h2645_parse.c
index 50837b6742..4d18de8b75 100644
--- a/libavcodec/h2645_parse.c
+++ b/libavcodec/h2645_parse.c
@@ -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 */