diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index b923d50c368f57be54910bc8ab8971540d3e96b4..f120858268aa9e6a624bdf2bb1250cd4c8cc8324 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -7104,7 +7104,7 @@ static inline int decode_vui_parameters(H264Context *h, SPS *sps){
         if( aspect_ratio_idc == EXTENDED_SAR ) {
             sps->sar.num= get_bits(&s->gb, 16);
             sps->sar.den= get_bits(&s->gb, 16);
-        }else if(aspect_ratio_idc < 16){
+        }else if(aspect_ratio_idc < 14){
             sps->sar=  pixel_aspect[aspect_ratio_idc];
         }else{
             av_log(h->s.avctx, AV_LOG_ERROR, "illegal aspect ratio\n");