diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 03:09:03 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-04 03:09:03 +0200 |
commit | bd6610c3b39e24ff3c3745cdfc5c69450bc7b0e5 (patch) | |
tree | b51de9e9fbaf3b9c21b14dcc551d7e0b39c61af9 /libavcodec | |
parent | 194dd155582d5b71fc3bb78ef77ce64d3f6c521d (diff) | |
download | ffmpeg-bd6610c3b39e24ff3c3745cdfc5c69450bc7b0e5.tar.gz |
avcodec/hevc_parser: Check init_get_bits8() for failure
Fixes: CID1322322
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/hevc_parser.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/hevc_parser.c b/libavcodec/hevc_parser.c index 35cace5e3c..fc107978c6 100644 --- a/libavcodec/hevc_parser.c +++ b/libavcodec/hevc_parser.c @@ -225,6 +225,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, for (;;) { int src_length, consumed; + int ret; buf = avpriv_find_start_code(buf, buf_end, &state); if (--buf + 2 >= buf_end) break; @@ -242,7 +243,10 @@ static inline int parse_nal_units(AVCodecParserContext *s, const uint8_t *buf, if (consumed < 0) return consumed; - init_get_bits8(gb, nal->data + 2, nal->size); + ret = init_get_bits8(gb, nal->data + 2, nal->size); + if (ret < 0) + return ret; + switch (h->nal_unit_type) { case NAL_VPS: ff_hevc_decode_nal_vps(gb, avctx, ps); |