diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c
index cfb77b078f237038cb591f56818da5ca68adc4c1..a6252f2905a4b60f197b6f000431c21707e73736 100644
--- a/libavcodec/h263dec.c
+++ b/libavcodec/h263dec.c
@@ -316,7 +316,8 @@ static int decode_slice(MpegEncContext *s)
     }
 
     if (s->workaround_bugs & FF_BUG_AUTODETECT) {
-        if (s->padding_bug_score > -2 && !s->data_partitioning)
+        if (s->codec_id == AV_CODEC_ID_H263 ||
+            (s->padding_bug_score > -2 && !s->data_partitioning))
             s->workaround_bugs |= FF_BUG_NO_PADDING;
         else
             s->workaround_bugs &= ~FF_BUG_NO_PADDING;