[FFmpeg-cvslog] h264_ps: check log2_max_frame_num for validity.

Michael Niedermayer git at videolan.org
Sat Apr 7 20:57:12 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Apr  7 17:02:36 2012 +0200| [192efcf76884f73c3f3d217862ac9e29afc94924] | committer: Michael Niedermayer

h264_ps: check log2_max_frame_num for validity.

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

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

 libavcodec/h264_ps.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index d9ed178..82b4e67 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -371,6 +371,12 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
     }
 
     sps->log2_max_frame_num= get_ue_golomb(&s->gb) + 4;
+    if (sps->log2_max_frame_num < 4 || sps->log2_max_frame_num > 16) {
+        av_log(h->s.avctx, AV_LOG_ERROR, "illegal log2_max_frame_num %d\n",
+               sps->log2_max_frame_num);
+        goto fail;
+    }
+
     sps->poc_type= get_ue_golomb_31(&s->gb);
 
     if(sps->poc_type == 0){ //FIXME #define



More information about the ffmpeg-cvslog mailing list