diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 79e4b0b..062d802 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -3071,11 +3071,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0)
 
     h->chroma_y_shift = h->sps.chroma_format_idc <= 1; // 400 uses yuv420p
 
-    h->width = 16 * h->mb_width - (2 >> CHROMA444) * FFMIN(h->sps.crop_right, (8 << CHROMA444) - 1);
-    if (h->sps.frame_mbs_only_flag)
-        h->height = 16 * h->mb_height - (1 << h->chroma_y_shift) * FFMIN(h->sps.crop_bottom, (16 >> h->chroma_y_shift) - 1);
-    else
-        h->height = 16 * h->mb_height - (2 << h->chroma_y_shift) * FFMIN(h->sps.crop_bottom, (16 >> h->chroma_y_shift) - 1);
+    h->width = h->mb_width * 16;
+    h->height = h->mb_height * 16;
 
     if (FFALIGN(h->avctx->width,  16) == h->width &&
         FFALIGN(h->avctx->height, 16) == h->height) {
@@ -4544,6 +4541,11 @@ out:
             *pict      = out->f;
         }
 
+        pict->width = avctx->coded_width - (2 >> CHROMA444) * h->sps.crop_right;
+        if (h->sps.frame_mbs_only_flag)
+            pict->height = avctx->coded_height - (1 << h->chroma_y_shift) * h->sps.crop_bottom;
+        else
+            pict->height = avctx->coded_height - (2 << h->chroma_y_shift) * h->sps.crop_bottom;
         return buf_index;
     }
 
@@ -4581,6 +4583,12 @@ out:
 
     assert(pict->data[0] || !*got_frame);
 
+    pict->width = avctx->coded_width - (2 >> CHROMA444) * h->sps.crop_right;
+    if (h->sps.frame_mbs_only_flag)
+        pict->height = avctx->coded_height - (1 << h->chroma_y_shift) * h->sps.crop_bottom;
+    else
+        pict->height = avctx->coded_height - (2 << h->chroma_y_shift) * h->sps.crop_bottom;
+
     return get_consumed_bytes(buf_index, buf_size);
 }
 
@@ -4602,6 +4610,12 @@ static av_cold int h264_decode_end(AVCodecContext *avctx)
     H264Context *h    = avctx->priv_data;
     int i;
 
+    avctx->width = avctx->coded_width - (2 >> CHROMA444) * h->sps.crop_right;
+    if (h->sps.frame_mbs_only_flag)
+        avctx->height = avctx->coded_height - (1 << h->chroma_y_shift) * h->sps.crop_bottom;
+    else
+        avctx->height = avctx->coded_height - (2 << h->chroma_y_shift) * h->sps.crop_bottom;
+
     ff_h264_free_context(h);
 
     if (h->DPB && !h->avctx->internal->is_copy) {
diff --git a/libavcodec/h264_ps.c b/libavcodec/h264_ps.c
index e35dab2..6fae8a2 100644
--- a/libavcodec/h264_ps.c
+++ b/libavcodec/h264_ps.c
@@ -414,8 +414,6 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
 #endif
     sps->crop= get_bits1(&h->gb);
     if(sps->crop){
-        int crop_vertical_limit   = sps->chroma_format_idc  & 2 ? 16 : 8;
-        int crop_horizontal_limit = sps->chroma_format_idc == 3 ? 16 : 8;
         sps->crop_left  = get_ue_golomb(&h->gb);
         sps->crop_right = get_ue_golomb(&h->gb);
         sps->crop_top   = get_ue_golomb(&h->gb);
@@ -437,9 +435,6 @@ int ff_h264_decode_seq_parameter_set(H264Context *h){
         if(sps->crop_left || sps->crop_top){
             av_log(h->avctx, AV_LOG_ERROR, "insane cropping not completely supported, this could look slightly wrong ...\n");
         }
-        if(sps->crop_right >= crop_horizontal_limit || sps->crop_bottom >= crop_vertical_limit){
-            av_log(h->avctx, AV_LOG_ERROR, "brainfart cropping not supported, this could look slightly wrong ...\n");
-        }
     }else{
         sps->crop_left  =
         sps->crop_right =
