[FFmpeg-cvslog] avcodec/hevc_ps: Check layer_id_included_flags count

Michael Niedermayer git at videolan.org
Sat Jul 12 07:51:29 CEST 2014


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Jul 12 05:15:31 2014 +0200| [66558fe715bf284467d13971a57ed492aa61bff4] | committer: Michael Niedermayer

avcodec/hevc_ps: Check layer_id_included_flags count

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=66558fe715bf284467d13971a57ed492aa61bff4
---

 libavcodec/hevc_ps.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/hevc_ps.c b/libavcodec/hevc_ps.c
index ffc9931..ee2c0ae 100644
--- a/libavcodec/hevc_ps.c
+++ b/libavcodec/hevc_ps.c
@@ -385,6 +385,11 @@ int ff_hevc_decode_nal_vps(HEVCContext *s)
 
     vps->vps_max_layer_id   = get_bits(gb, 6);
     vps->vps_num_layer_sets = get_ue_golomb_long(gb) + 1;
+    if ((vps->vps_num_layer_sets - 1LL) * (vps->vps_max_layer_id + 1LL) > get_bits_left(gb)) {
+        av_log(s->avctx, AV_LOG_ERROR, "too many layer_id_included_flags\n");
+        goto err;
+    }
+
     for (i = 1; i < vps->vps_num_layer_sets; i++)
         for (j = 0; j <= vps->vps_max_layer_id; j++)
             skip_bits(gb, 1);  // layer_id_included_flag[i][j]



More information about the ffmpeg-cvslog mailing list