[FFmpeg-devel] [PATCH] hevc: fix size condition in ptl parsing

Hendrik Leppkes h.leppkes at gmail.com
Fri May 6 19:15:06 CEST 2016


When only one sublayer is present, no information is coded. Only when at least two
are present, all 8 sublayers are written.
---
 libavcodec/hevc_ps.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index ce3f3df..83f2ec2 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -280,7 +280,7 @@ static int parse_ptl(GetBitContext *gb, AVCodecContext *avctx,
 {
     int i;
     if (decode_profile_tier_level(gb, avctx, &ptl->general_ptl) < 0 ||
-        get_bits_left(gb) < 8 + 8*2) {
+        get_bits_left(gb) < 8 + (8*2 * (max_num_sub_layers - 1 > 0))) {
         av_log(avctx, AV_LOG_ERROR, "PTL information too short\n");
         return -1;
     }
-- 
2.7.2.windows.1



More information about the ffmpeg-devel mailing list